Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local api = require("GuiH")
- local graphic = require("GuiH.texture-wrapper").code
- local gui = api.create_gui(term.current())
- local among_us = gui.load_ppm_texture("sus.ppm")
- local fblack,fwhite = api.presets.rect.frame(colors.white,colors.black),api.presets.rect.frame(colors.black,colors.black)
- local frame = gui.create.frame({
- x=2,y=2,width=5,height=4,
- dragger={x=1,y=1,width=5,height=4}
- })
- local sGui = frame.child
- sGui.create.script({
- graphic=function(object)
- local term = object.canvas.term_object
- graphic.draw_box_tex(
- frame.window,among_us,2,2,3,2
- )
- end,
- graphic_order=3
- })
- local rect = sGui.create.rectangle({
- x=1,y=1,width=5,height=4,
- graphic_order=0,
- symbols = api.presets.rect.frame(colors.white,colors.black),
- visible=true,
- graphic_order=2
- })
- sGui.create.script({
- code=function(object)
- rect.symbols = (frame.dragged and frame.dragable)and fblack or fwhite
- end,
- logic_order=2
- })
- sGui.create.switch({
- text=sGui.text({
- x=1,y=1,transparent=true,
- text="lock"
- }),
- text_on=sGui.text({
- x=1,y=1,transparent=true,
- text="lock"
- }),
- background_color=colors.red,
- background_color_on=colors.green,
- x=1,y=1,width=4,height=1,
- on_change_state=function(object)
- frame.dragable = not object.value
- end,
- graphic_order=4
- })
- gui.execute()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement