68 posts
Location
Land of the Pharos
Posted 22 July 2017 - 06:31 AM
as the name implies I need help with auto centering text on a screen. I remember seeing something like this in a different program that used the math api but I cant figure out how to do the same!
any and all help appreciated!
1220 posts
Location
Earth orbit
Posted 22 July 2017 - 06:50 AM
To center text horizontally, simply subtract the width of the text from the width of the terminal and divide the result by two.
To center vertically, subtract the height of the text from the height of the terminal and divide by two.
You can use math.floor() or math.ceil() to round down or up to the nearest whole number.
Edited on 22 July 2017 - 04:51 AM
68 posts
Location
Land of the Pharos
Posted 22 July 2017 - 06:54 AM
well thank you! that was quick!