Schneemann

GUI-lib.lua

Oct 24th, 2021
857
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local component=require("component")
  2. local term=require("term")
  3. local color=require("color")
  4. local gpu=require("gpu")
  5.  
  6. local gui={}
  7.  
  8. local windows = {
  9.   ["exampleWindow"] = {
  10.         {id = 0, active = false, width = 40, height = 90, locx = 1, locy = 1, backColor = 15, foreColor = 7}
  11.         ["exampleButton"] = {id = 0, func = (function() print("this is an example button"), width = 10, height = 3, locx = 3, locy = 5, text = "click", position = "centered"}
  12.     }
  13. }
  14.    
  15. local test = {}
  16.  
  17. function gui.createWindow(name,width,height,locx,locy,backColor,foreColor)
  18.  
  19. end
  20.    
  21. function gui.createLabel(name,width,height,locx,locy,foreColor,backColor,text)
  22.      
  23.    
  24.    
  25. end
  26.    
  27. function gui.createTest(name,width,height,locx,locy,color)
  28.     test["name"] = name
  29.     test["name"]["width"] = width
  30.     test["name"]["height"] = height
  31.     test["name"]["locx"] = locx
  32.     test["name"]["locy"] = locy
  33.     test["name"]["color"] = color
  34. end
  35.  
  36. function gui.update()
  37.     gpu.fill(test["name"]["locx"],test["name"]["locy"],test["name"]["width"],test["name"]["height"],test["name"]["color"])
  38. end
  39.    
  40. return gui
RAW Paste Data