Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("Test/GIF")
- os.loadAPI("Test/blittle")
- local mon = peripheral.find("monitor")
- mon.setTextScale(0.5)
- mon.setBackgroundColour(colors.black)
- mon.clear()
- local fileName = "Test/Carte/Carte.gif"
- local x, y = mon.getSize()
- local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
- blittle.draw(image, 75, 10, mon)
- --Affichage boutton
- local fileName = "Test/Hit.gif"
- local x, y = mon.getSize()
- local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
- blittle.draw(image, 70, 75, mon)
- local fileName = "Test/Stand.gif"
- local x, y = mon.getSize()
- local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
- blittle.draw(image, 90, 75, mon)
- --
- while true do
- --Bouton Hit
- if true then
- local event, side, x, y = os.pullEvent("monitor_touch")
- if x > 70 then
- if x < 80 then
- if y > 75 then
- if y < 79 then
- print("Hit")
- local fileName = "Test/HitP.gif"
- local x, y = mon.getSize()
- local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
- blittle.draw(image, 70, 75, mon)
- sleep(0.5)
- local fileName = "Test/Hit.gif"
- local x, y = mon.getSize()
- local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
- blittle.draw(image, 70, 75, mon)
- end
- end
- end
- end
- end
- --
- --Bouton Stand
- if true then
- local event, side, x, y = os.pullEvent("monitor_touch")
- if x > 90 then
- if x < 107 then
- if y > 75 then
- if y < 79 then
- print("Stand")
- local fileName = "Test/StandP.gif"
- local x, y = mon.getSize()
- local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
- blittle.draw(image, 90, 75, mon)
- sleep(0.5)
- local fileName = "Test/Stand.gif"
- local x, y = mon.getSize()
- local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
- blittle.draw(image, 90, 75, mon)
- end
- end
- end
- end
- end
- --
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment