Advertisement
Arc13

banane

Jun 2nd, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. os.loadAPI("GIF")
  2.  
  3. local mon = peripheral.find("monitor")
  4.  
  5. local gifs = fs.find("*.gif") -- Note: fs.find() is case-sensitive, even if your file system isn't.
  6.  
  7. mon.setTextScale(0.5)
  8. local x, y = mon.getSize()
  9.  
  10. while true do for i = 1, #gifs do
  11. local image = GIF.loadGIF(gifs[i])
  12. mon.setBackgroundColour(image[1].transparentCol or image.backgroundCol)
  13. mon.clear()
  14.  
  15. GIF.setBackgroundColor(image, colors.black)
  16.  
  17. if x < image.width or y < image.height then
  18. if x < math.floor(y / image.height * image.width) then
  19. image = GIF.resizeGIF(image, x)
  20. else
  21. image = GIF.resizeGIF(image, nil, y)
  22. end
  23. end
  24.  
  25.  
  26. parallel.waitForAny(
  27. function()
  28. GIF.animateGIF(image, math.floor((x - image.width) / 2) + 1, math.floor((y - image.height) / 2) + 1, mon)
  29. end,
  30.  
  31. function()
  32. sleep(10)
  33. end
  34. )
  35. end end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement