TheSommer

FoodVendor

Feb 6th, 2020
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local function centerText(text)
  2.   x,y = term.getSize()
  3.   x1,y1 = term.getCursorPos()
  4.   term.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
  5.   term.write(text)
  6. end
  7.  
  8. term.clear()
  9.  
  10. x,y = term.getSize()
  11. x1, y1 = term.getCursorPos()
  12. term.setCursorPos(x1, math.floor(y/2))
  13. centerText("Nan-ni shimasho-ka?")
  14.  
  15. x1, y1 = term.getCursorPos()
  16. term.setCursorPos(1, math.floor(y))
Advertisement
Add Comment
Please, Sign In to add comment