Advertisement
TG_Vulcano

center

Jun 20th, 2023
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. local function write_center(text)
  2. local x, y = term.getCursorPos()
  3. local width, height = term.getSize()
  4. term.setCursorPos(math.floor((width - #text) / 2) + 1, y)
  5. term.write(text)
  6. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement