Advertisement
Guest User

centerText

a guest
Jul 25th, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.17 KB | None | 0 0
  1. function centerText(text)
  2.   local x,y =term.getSize()
  3.   local x2,y2 = term.getCursorPos()
  4.   term.setCursorPos(math.ceil((x/2) - (text:len() / 2)), y2)
  5.   print(text)
  6. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement