Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function centerText(monitor, text, left)
- local x,y = monitor.getSize()
- local x2,y2 = monitor.getCursorPos()
- local fractionalXPos = x / 2 - (text:len() / 2)
- local newXPos = 0
- if(left) then
- newXPos = math.ceil(fractionalXPos)
- else
- newXPos = math.floor(fractionalXPos)
- newXPos = newXPos + 1
- end
- monitor.setCursorPos(newXPos, y2)
- monitor.write(text)
- end
- monitor = peripheral.wrap("right")
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.setTextScale(5)
- centerText(monitor, "Maelstrom", true)
- monitor.setCursorPos(1,2)
- centerText(monitor, "Research", false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement