Advertisement
Guest User

Untitled

a guest
May 8th, 2022
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. local api = require("GuiH")
  2. local graphic = require("GuiH.texture-wrapper").code
  3. local gui = api.create_gui(term.current())
  4.  
  5. local among_us = gui.load_ppm_texture("sus.ppm")
  6. local fblack,fwhite = api.presets.rect.frame(colors.white,colors.black),api.presets.rect.frame(colors.black,colors.black)
  7.  
  8. local frame = gui.create.frame({
  9. x=2,y=2,width=5,height=4,
  10. dragger={x=1,y=1,width=5,height=4}
  11. })
  12. local sGui = frame.child
  13.  
  14. sGui.create.script({
  15. graphic=function(object)
  16. local term = object.canvas.term_object
  17. graphic.draw_box_tex(
  18. frame.window,among_us,2,2,3,2
  19. )
  20. end,
  21. graphic_order=3
  22. })
  23.  
  24. local rect = sGui.create.rectangle({
  25. x=1,y=1,width=5,height=4,
  26. graphic_order=0,
  27. symbols = api.presets.rect.frame(colors.white,colors.black),
  28. visible=true,
  29. graphic_order=2
  30. })
  31.  
  32. sGui.create.script({
  33. code=function(object)
  34. rect.symbols = (frame.dragged and frame.dragable)and fblack or fwhite
  35. end,
  36. logic_order=2
  37. })
  38.  
  39. sGui.create.switch({
  40. text=sGui.text({
  41. x=1,y=1,transparent=true,
  42. text="lock"
  43. }),
  44. text_on=sGui.text({
  45. x=1,y=1,transparent=true,
  46. text="lock"
  47. }),
  48. background_color=colors.red,
  49. background_color_on=colors.green,
  50. x=1,y=1,width=4,height=1,
  51. on_change_state=function(object)
  52. frame.dragable = not object.value
  53. end,
  54. graphic_order=4
  55. })
  56.  
  57. gui.execute()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement