Advertisement
STATEDLIGHT

to mon

Mar 18th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. local sText = "EXIT" -- You can change the text
  2. local sSide = "back" -- you can change the side of the monitor
  3. local nTextSize = 3 -- change the text size here (from 1 to 5)
  4. local nTextColor = green
  5.  
  6. local function printCenter(mon, txt)
  7. local w, h = mon.getSize()
  8. local x = math.floor((w / 2) - (#txt / 2))
  9. local y = math.floor((h / 2))
  10. mon.setCursorPos(x, y)
  11. mon.write(txt)
  12. end
  13.  
  14. local monitor = peripheral.wrap(sSide)
  15. printCenter(monitor, sText)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement