Advertisement
Guest User

box

a guest
Dec 11th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.15 KB | None | 0 0
  1. local m = 1
  2. while m == 1 do
  3.  
  4. local GUI = require("GUI")
  5. local GUS = dofile("/lib/GUI.lua")
  6. local buffer = require("doubleBuffering")
  7. local base = GUI.application()
  8. local n = 9
  9.  
  10. local s = -1
  11. local FillValue = 2
  12.  
  13.  
  14. local Fill = math.random(10, 60)
  15. --base.eventHandler = function(application, object, ...)
  16. print(Fill)
  17. -- end
  18. local sfnd = base:addChild(GUI.panel(1, 1, 160, 50, 0xffb700))
  19. local widg1 = base:addChild(GUI.container(3, 2, 50, 47))
  20. local sfndwidg1 = widg1:addChild(GUI.panel(widg1.x, widg1.y, widg1.width, widg1.height, 0xd11919))
  21. local inboxwidg1 = widg1:addChild(GUI.panel(widg1.x+2, widg1.y+1, widg1.width-6, widg1.height-3, 0xffffff))
  22.  
  23. --application:addChild(GUI.label(3, 2, 30, 1, 0xFFFFFF, "Text for size comparison"))
  24. local Canvas = base:addChild(GUS.brailleCanvas(inboxwidg1.x+2, inboxwidg1.y+2, 5, 15))
  25. local canvaspxWidth = Canvas.width * 2
  26. local canvaspxHeight = Canvas.height * 4
  27. --for i=1, Canvas.width * 2 do
  28. --Canvas:set(i, 1, true, 0x000000)
  29. --Canvas:set(i, canvaspxHeight, true, 0x000000)
  30. --end
  31. Canvas:fill(3, FillValue, canvaspxWidth-3, 20, true, 0xFFDB40)
  32. for i = 1, Canvas.height * 4 do
  33.     Canvas:set(2, i, true, 0x10e329)
  34.     Canvas:set(canvaspxWidth-1, i, true, 0x10e329)
  35. end
  36. local Canvas2 = base:addChild(GUS.brailleCanvas(inboxwidg1.x+6, inboxwidg1.y+2, 5, 15))
  37. local canvas2pxWidth = Canvas2.width * 2
  38. local canvas2pxHeight = Canvas2.height * 4
  39. for i=3, (Canvas2.width * 2)-1 do
  40. Canvas2:set(i, 1, true, 0x000000)
  41. Canvas2:set(i, canvaspxHeight, true, 0x000000)
  42. end
  43. Canvas2:fill(3, FillValue, canvas2pxWidth-3, 20, true, 0xFFDB40)
  44. for i = 1, Canvas2.height * 4 do
  45.     Canvas2:set(2, i, true, 0x10e329)
  46.     Canvas2:set(canvaspxWidth-1, i, true, 0x10e329)
  47. end
  48.  
  49. local menu = widg1:addChild(GUI.menu(inboxwidg1.x, inboxwidg1.y, inboxwidg1.width, 0xEEEEEE, 0x666666, 0x3366CC, 0xFFFFFF))
  50. local swapmenu = menu:addContextMenu("MineCode IDE", 0x0)
  51. menu:addItem("i9xhila").onTouch = function() m = 1 end
  52. menu:addItem("F8sdh").onTouch = function() m = 0 end
  53. menu:addItem("azz1").onTouch = function() Canvas:clear() end
  54. menu:addItem("Esci").onTouch = function()
  55.     os.exit()
  56. end
  57. for i=n, 1, -1 do      
  58. swapmenu:addItem("Reattore", i)
  59. end
  60. base:draw(true)
  61. base:start()
  62.  
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement