Advertisement
Doskyft

Text

Jul 9th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. function centerText(text, y, color)
  2.     -- mon.clear
  3.     mx = mon.getSize()
  4.     x = math.floor(mx/2) - math.floor(string.len(text)/2)
  5.     mon.setCursorPos(x, y)
  6.     mon.setTextColor(color)
  7.     mon.write(text)
  8. end
  9.     mon = peripheral.wrap("bottom")
  10.     mon.setTextScale(1.4)
  11.     mon.setBackgroundColor(colors.black)
  12.     -- mon.clear()
  13.         centerText("---------", 1, 16384)
  14.         centerText("---------", 1, 16)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement