This is a simple Lua and CC Advanced Computers and Montors Graphical User Interface API. It is Object Oriented, so you program "like" if it were using Swing in Lua. ATM, I don't have much time, but I will begin to make reference materials on this thread. Latest Stable Release: v0.1a How to Install: Download RAR archive and extract to computer. Upload to ROOT directory of computer using FTP. Use dofile with an argument pointing to the sGUIAPI.lua file within the sGUIAPI folder to load the API. Sample Program: Code: dofile("sGUIAPI/sGUIAPI.lua") -- Load API display = Display:new("left") -- Bind a display to the left side function slapPerson() -- Slap person here end epicButton = Button:new("Epic", Rectangle:new(10, 10, 10, 3), colors.white, colors.red, slapPerson) -- Make a epic button display:addChild(epicButton) -- Add the button to the display lameButton = Button:new("Lame", Rectangle:new(1, 1, 10, 3), colors.white, 0) -- Make a lame button lameButton.visible = false -- Hide the lame button display:addChild(lameButton) while true do display:render() -- Render everything local event, p1, p2, p3, p4, p5 = os.pullEventRaw() -- Get some events display:interceptEvent(event, p1, p2, p3, p4, p5) -- Send the events you don't want to the display end Known Bugs: Bar label color cannot be omitted. Random rounding errors. (Esp. w/ small numbers in the Progress Bar)
Documentation: WIP Class List: Rectangle Display Label Button Bar Rule Util Code: Rectangle:new(x, y, width, height) Display:new([side]) -- returns a display object bound to that side or term if not specified Display:render() -- render, call the render screen Display:interceptEvent(event, p1, p2, p3, p4, p5) -- event intercept, call to handle monitor touch events Display:addChild(component) -- adds a child Display:removeChild(child) -- removes a child Util:pointWithin(point, rectangle) -- is the point inside the rectangle? -- Generics for below *.visible -- visiblity *.callback -- callback Label:new(text, position, [textColor, bgColor, callback]) -- returns a new label component Label.text -- text of label Label.textColor -- color of label Label.bgColor -- color of background Button:new(label, position, [labelColor, buttonColor, callback]) -- returns a new button component Button.label -- label Button.labelColor -- color of label Button.buttonColor -- color of button Bar:new(label, unit, position, textColor, [barFGColor, barBGColor, callback]) -- returns a new progress bar component Bar.label -- label Bar.textColor -- color of label Bar.fgColor -- color of bar Bar.bgColor -- color of bar background Rule:new(kind, position, [color, callback]) -- returns a new rule component Rule.VERTICAL = 1 -- vertical rule kind Rule.HORIZONTAL = 2 -- horizontal rule kind Rule.color = -- rule color Notes: Color parameters can be set to zero or omitted to be used as transparent. Rules use the width parameter from Rectangle for their length. No changes to component parameters will take effect until a re-render. Display renders clear the screen. All fields in classes are exposed, but it is of your best interest to not attempt to mess with them. Make sure you use colons ( : ) for functions and periods ( . ) for fields in the classes. Classes go bonkers without it.