Advertisement
Guest User

welcome

a guest
Mar 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. local tText = {
  2. "First line", -- you can change the lines here
  3. "Second line",
  4. "Some more",
  5. "lines here"
  6. -- and you can add more if you want, just don't forget to put the commas (,) at the end of the lines (except for the last one)
  7. }
  8. local sSide = "left"
  9. local nTextSize = 1 -- change the text size here (from 1 to 5)
  10.  
  11. local function printCenter(mon, t)
  12. local w, h = mon.getSize()
  13. local y = math.floor((h / 2) - (#t / 2)) - 1
  14. for i, line in ipairs(t) do
  15. local x = math.floor((w / 2) - (#line / 2))
  16. mon.setCursorPos(x, y + i)
  17. mon.write(line)
  18. end
  19. end
  20.  
  21. local mon = peripheral.wrap(right)
  22. mon.setTextScale(nTextSize)
  23. printCenter(mon, tText)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement