Cubix_Gamer

Untitled

May 18th, 2021 (edited)
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. local x, y = mon.getSize()
  13. local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
  14. blittle.draw(image, 75, 10, mon)
  15.  
  16. --Affichage boutton
  17. local fileName = "Test/Hit.gif"
  18. local x, y = mon.getSize()
  19. local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
  20. blittle.draw(image, 70, 75, mon)
  21.  
  22. local fileName = "Test/Stand.gif"
  23. local x, y = mon.getSize()
  24. local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
  25. blittle.draw(image, 90, 75, mon)
  26. --
  27.  
  28. while true do
  29.  
  30. --Bouton Hit
  31. if true then
  32. local event, side, x, y = os.pullEvent("monitor_touch")
  33. if x > 70 then
  34. if x < 80 then
  35. if y > 75 then
  36. if y < 79 then
  37. print("Hit")
  38. local fileName = "Test/HitP.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. sleep(0.5)
  43. local fileName = "Test/Hit.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. end
  48. end
  49. end
  50. end
  51. end
  52. --
  53.  
  54. --Bouton Stand
  55. if true then
  56. local event, side, x, y = os.pullEvent("monitor_touch")
  57. if x > 90 then
  58. if x < 107 then
  59. if y > 75 then
  60. if y < 79 then
  61. print("Stand")
  62. local fileName = "Test/StandP.gif"
  63. local x, y = mon.getSize()
  64. local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
  65. blittle.draw(image, 90, 75, mon)
  66. sleep(0.5)
  67. local fileName = "Test/Stand.gif"
  68. local x, y = mon.getSize()
  69. local image = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)))
  70. blittle.draw(image, 90, 75, mon)
  71. end
  72. end
  73. end
  74. end
  75. end
  76. --
  77.  
  78. sleep(0.1)
  79. end
Advertisement
Add Comment
Please, Sign In to add comment