Advertisement
meuced

gif

Jan 23rd, 2016
612
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. if not fs.exists("package") then shell.run("pastebin get cUYTGbpb package") end
  2. if not fs.exists("GIF") then shell.run("pastebin get 5uk9uRjC GIF") end
  3. if not fs.exists("blittle") then shell.run("pastebin get ujchRSnU blittle") end
  4.  
  5. os.loadAPI("GIF")
  6. os.loadAPI("blittle")
  7.  
  8. local fileName, backgroundCol = "someImage.gif", colours.white
  9.  
  10. local mon = peripheral.find("monitor")
  11. mon.setTextScale(0.5)
  12. mon.setBackgroundColour(backgroundCol)
  13. mon.clear()
  14.  
  15. local x, y = mon.getSize()
  16.  
  17. local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)), backgroundCol)
  18.  
  19. blittle.draw(image, math.floor((x-image.width)/2)+1, math.floor((y-image.height)/2)+1, mon)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement