Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("GIF")
- local mon = peripheral.find("monitor")
- local gifs = fs.find("*.gif") -- Note: fs.find() is case-sensitive, even if your file system isn't.
- mon.setTextScale(0.5)
- local x, y = mon.getSize()
- while true do for i = 1, #gifs do
- local image = GIF.loadGIF(gifs[i])
- mon.setBackgroundColour(image[1].transparentCol or image.backgroundCol)
- mon.clear()
- GIF.setBackgroundColor(image, colors.black)
- if x < image.width or y < image.height then
- if x < math.floor(y / image.height * image.width) then
- image = GIF.resizeGIF(image, x)
- else
- image = GIF.resizeGIF(image, nil, y)
- end
- end
- parallel.waitForAny(
- function()
- GIF.animateGIF(image, math.floor((x - image.width) / 2) + 1, math.floor((y - image.height) / 2) + 1, mon)
- end,
- function()
- sleep(10)
- end
- )
- end end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement