Advertisement
honeyphos1234

computercraft horizontal scrolling text

Jun 23rd, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Settings
  2. mon = peripheral.wrap("left") --Screen Side
  3. mon.setTextScale(4)           --Text Size
  4. mon.setTextColor(colors.blue) --Text Color
  5. speed = 0.2                   --Scroll Speed (Seconds)
  6. text = "This is some Text"    --Displayed Text
  7. strtpos = string.len((text)*1.3+5)--Start position on screen
  8.  
  9. pos = strtpos
  10. poslimit = 0 - strtpos
  11.  
  12. while true do
  13.  mon.clear()
  14.  mon.setCursorPos(pos, 1)
  15.  mon.write(text)
  16.  sleep(speed)
  17.  if pos == poslimit then
  18.   pos = strtpos
  19.  else
  20.   pos = pos - 1
  21.  end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement