carrots084

centerText

Jul 27th, 2014
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. function centerText()
  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