Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function centerText(text)
- m = peripheral.wrap("back")
- local x,y = m.getSize()
- local x2,y2 = m.getCursorPos()
- m.clear()
- m.setTextColor(colors.red)
- m.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- m.write(text)
- end
- centerText("Hello World")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement