Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.find("monitor")
- function cls()
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(1, 1)
- mon.clear()
- end
- function center(words)
- local x, y = mon.getSize()
- local posx = math.floor((x / 2) - (string.len(words) / 2) + 1)
- local posy = math.floor((y / 2) + 1)
- mon.setCursorPos(posx, posy)
- mon.write(words)
- end
- function center2(words, xmin, ymin)
- local x = xmin
- local y = ymin
- --print(words)
- --print(x)
- local posx = math.floor((x / 2) - (string.len(words) / 2) + 1)
- local posy = math.floor((y / 2) + 1)
- cls()
- --local prevColor = mon.getBackgroundColor()
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(xmin, ymin)
- mon.write(words)
- mon.setBackgroundColor(colors.black)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement