SHOW:
|
|
- or go back to the newest paste.
| 1 | os.loadAPI("Test/GIF")
| |
| 2 | os.loadAPI("Test/blittle")
| |
| 3 | ||
| 4 | local mon = peripheral.find("monitor")
| |
| 5 | mon.setTextScale(0.5) | |
| 6 | mon.setBackgroundColour(colors.black) | |
| 7 | mon.clear() | |
| 8 | ||
| 9 | ||
| 10 | ||
| 11 | local fileName = "Test/Carte/Carte.gif" | |
| 12 | - | blittle.draw(image, 10, 10, mon) |
| 12 | + | |
| 13 | local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName))) | |
| 14 | - | local fileName = "Test/Carte/CarteA.gif" |
| 14 | + | blittle.draw(image, 75, 10, mon) |
| 15 | ||
| 16 | --Affichage boutton | |
| 17 | - | blittle.draw(image, 10, 10, mon) |
| 17 | + | local fileName = "Test/Hit.gif" |
| 18 | local x, y = mon.getSize() | |
| 19 | - | local fileName = "Test/Carte/Carte2.gif" |
| 19 | + | |
| 20 | blittle.draw(image, 70, 75, mon) | |
| 21 | ||
| 22 | - | blittle.draw(image, 10, 10, mon) |
| 22 | + | local fileName = "Test/Stand.gif" |
| 23 | local x, y = mon.getSize() | |
| 24 | - | local fileName = "Test/Carte/Carte3.gif" |
| 24 | + | |
| 25 | blittle.draw(image, 90, 75, mon) | |
| 26 | -- | |
| 27 | - | blittle.draw(image, 10, 10, mon) |
| 27 | + | |
| 28 | while true do | |
| 29 | - | local fileName = "Test/Carte/Carte4.gif" |
| 29 | + | |
| 30 | --Bouton Hit | |
| 31 | if true then | |
| 32 | - | blittle.draw(image, 10, 10, mon) |
| 32 | + | local event, side, x, y = os.pullEvent("monitor_touch")
|
| 33 | if x > 70 then | |
| 34 | - | local fileName = "Test/Carte/Carte5.gif" |
| 34 | + | if x < 80 then |
| 35 | if y > 75 then | |
| 36 | if y < 79 then | |
| 37 | - | blittle.draw(image, 10, 10, mon) |
| 37 | + | print("Hit")
|
| 38 | local fileName = "Test/HitP.gif" | |
| 39 | - | local fileName = "Test/Carte/Carte6.gif" |
| 39 | + | local x, y = mon.getSize() |
| 40 | local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName))) | |
| 41 | blittle.draw(image, 70, 75, mon) | |
| 42 | - | blittle.draw(image, 10, 10, mon) |
| 42 | + | sleep(0.5) |
| 43 | local fileName = "Test/Hit.gif" | |
| 44 | - | local fileName = "Test/Carte/Carte7.gif" |
| 44 | + | local x, y = mon.getSize() |
| 45 | local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName))) | |
| 46 | blittle.draw(image, 70, 75, mon) | |
| 47 | - | blittle.draw(image, 10, 10, mon) |
| 47 | + | end |
| 48 | end | |
| 49 | - | local fileName = "Test/Carte/Carte8.gif" |
| 49 | + | end |
| 50 | end | |
| 51 | end | |
| 52 | - | blittle.draw(image, 10, 50, mon) |
| 52 | + | -- |
| 53 | ||
| 54 | - | local fileName = "Test/Carte/Carte9.gif" |
| 54 | + | --Bouton Stand |
| 55 | if true then | |
| 56 | local event, side, x, y = os.pullEvent("monitor_touch")
| |
| 57 | - | blittle.draw(image, 10, 100, mon) |
| 57 | + | if x > 90 then |
| 58 | if x < 107 then | |
| 59 | - | local fileName = "Test/Carte/Carte10.gif" |
| 59 | + | if y > 75 then |
| 60 | if y < 79 then | |
| 61 | print("Stand")
| |
| 62 | - | blittle.draw(image, 10, 100, mon) |
| 62 | + | local fileName = "Test/StandP.gif" |
| 63 | local x, y = mon.getSize() | |
| 64 | - | local fileName = "Test/Carte/CarteJ.gif" |
| 64 | + | local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName))) |
| 65 | blittle.draw(image, 90, 75, mon) | |
| 66 | sleep(0.5) | |
| 67 | - | blittle.draw(image, 10, 100, mon) |
| 67 | + | local fileName = "Test/Stand.gif" |
| 68 | local x, y = mon.getSize() | |
| 69 | - | local fileName = "Test/Carte/CarteQ.gif" |
| 69 | + | local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName))) |
| 70 | blittle.draw(image, 90, 75, mon) | |
| 71 | end | |
| 72 | - | blittle.draw(image, 10, 100, mon) |
| 72 | + | end |
| 73 | end | |
| 74 | - | local fileName = "Test/Carte/CarteK.gif" |
| 74 | + | end |
| 75 | end | |
| 76 | -- | |
| 77 | - | blittle.draw(image, 10, 100, mon) |
| 77 | + | |
| 78 | sleep(0.1) | |
| 79 | - | |
| 79 | + | end |