Advertisement
hbar

paxscreen

Mar 16th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. -- dimensions of the screen and side with the modem
  2. -- works best if the screen has the same aspect ratio
  3. -- as the images
  4. width = 32
  5. height = 18
  6. modemside = "back"
  7.  
  8. -- how long each image is displayed before switching (in seconds)
  9. delay = 10
  10.  
  11. -- URLs to the desired images
  12. -- the images need to be the same size
  13. -- or at least the same aspect ratio
  14. url1 = "http://"
  15. url2 = "http://"
  16. url3 = "http://"
  17.  
  18. -- you can fiddle with these if the
  19. -- transitions don't look smooth
  20. speed = 5
  21. steps = 10
  22.  
  23. ----------------------------------------------------------------
  24. os.load("lumiere")
  25.  
  26. img1 = lumiere.getImage(url1,width)
  27. img2 = lumiere.getImage(url2,width)
  28. img3 = lumiere.getImage(url3,width)
  29.  
  30. if (not img1) or (not img2) or (not img3) then
  31.     print("Error loading images. Check your URLs or contact maintenance.")
  32.     return
  33. end
  34.  
  35. screen = lumiere.initScreen(width,height,modemside)
  36. screen:setColor("0xFFFFFF")
  37.  
  38. while true do
  39.     lumiere.fade(screen,img1,img2,steps,speed)
  40.     sleep(delay)
  41.     lumiere.fade(screen,img2,img3,steps,speed)
  42.     sleep(delay)
  43.     lumiere.fade(screen,img3,img1,steps,speed)
  44.     sleep(delay)
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement