Page 1 of 17

Gspöt - retained GUI lib

Posted: Wed Mar 07, 2012 11:39 am
by trubblegum
Like the subject says, it's a stateful gui (moved to new thread from "what are you working on")

Features include :
- single file lib for easy inclusion
- range of one-line GUI elements with default functionality, including circular elements, button, checkbox, scrollgroup, auto-positioning feedback, etc
- easy callbacks for a wide range of events
- element grouping with cascading styles
- flexible positioning type with operator functions
- instanced GUI for easy implementation and interaction across multiple screens
- direct access to GUI elements and attributes via reference

Code: Select all

gui = require('Gspot')

button = gui:button('do thing', {x = 64, y = 64, w = 64})
button.click = function(this) gui:feedback('thing done') end
Although all planned functionality is working, I would still consider this a work in progress, as it remains to some degree untested, and I'm open to suggestions and requests.

github : https://github.com/trubblegum/Gspot

I try to keep the github wiki up to date, but it may lag a day or two behind.

The license says you can do what you want with it, but don't blame me if you break it or it breaks you :)
enjöy
Gspot.love
Gspot lib + demo
(10.38 KiB) Downloaded 2142 times

Re: Yet another stateful GUI

Posted: Wed Mar 07, 2012 12:05 pm
by trubblegum
Correction :
option elements now receive focus and respond to the done() event without using the keyboard to edit their value.

Re: Yet another stateful GUI

Posted: Wed Mar 07, 2012 12:36 pm
by coffee
I don't think this "is another" one. It deserves a name.
Silly suggestion. Use another grey variation for the scrollbar when focused.
As I told in original WIP thread the "dn" button aligned with last option is more natural. Probably for now "only" missing multiple select.
Seems all quite nice and would be a nice library. Very nice work trubblegum!

Re: Yet another stateful GUI

Posted: Wed Mar 07, 2012 12:43 pm
by trubblegum
Thanks very much :)

Re scrollbar controls : they're only there to demonstrate interacting with the scrollbar from outside of its element, so their positioning is entirely down to the individual implementation.

Re a name : I wanted to call it "gooey", but it looks like that one was taken a long time ago.
I might call it FTLgui (For The Löve, not Faster Than Light or For The Lose), as I'l probably be making more libraries which can use the same prefix.
Any other suggestions?

Re: Yet another stateful GUI

Posted: Wed Mar 07, 2012 1:02 pm
by coffee
trubblegum wrote: Any other suggestions?
In LOVE tradition "G-Spot" = Graphical SPatial Oriented Technology, lol

Re: Yet another stateful GUI

Posted: Wed Mar 07, 2012 1:09 pm
by trubblegum
Very nice! I may go with "Gspöt" :megagrin:

Re: Gspöt - formerly Yet another stateful GUI

Posted: Wed Mar 07, 2012 2:44 pm
by trubblegum
Now with added text elements, lövingly formatted by the gui.

Re: Gspöt - formerly Yet another stateful GUI

Posted: Wed Mar 07, 2012 4:48 pm
by trubblegum
Elements should now be show/hide-able, along with their children (elementlets?).

Re: Gspöt - formerly Yet another stateful GUI

Posted: Fri Mar 09, 2012 2:13 am
by trubblegum
Now with instancing and .love for your convenience.

bugs : Automatic stacking in scrollgroup isn't right, and I'm not sure why.

Some changes :
- most functions need to have a reference to the gui object passed to them, in order to support multiple gui instances.
- elements now carry a reference to their gui in element.Gspot, to make things, shall we say .. easier to find :monocle:

Re: Gspöt - formerly Yet another stateful GUI

Posted: Fri Mar 09, 2012 9:48 am
by coffee
Thanks for the .love. Easier this way. Strangely after so much of your work, only now got now a first error/problem. Please right click in head/title of Lorem ipsum box. 504 line error right?

There's a reason for scrollbar "handler" when at top/bottom be smaller? Shouldn't the height of it be constant?

Things are looking good, however the demo don't seem show all power of the gui like for example show all easy hide a object (and subojects). Great work.