Page 7 of 17
Re: Gspöt - formerly Yet another stateful GUI
Posted: Fri Mar 16, 2012 12:10 pm
by trubblegum
I'll start a new thread at some point for Gscrooter, or SCREWformer, or whatever the hell it ends up being called.
In the mean, here's a nice little feedback object for a Gspot element's click() or whatever :
Code: Select all
feedback = this.Gspot:element(this.Gspot:text('No Such Thinger D:', {x = 0, y = 32, w = 256, h = 16}, this.id))
feedback.alpha = 255
feedback.update = function(this, dt)
this.alpha = this.alpha - (255 * dt)
if this.alpha < 0 then this.Gspot:rem(this.id) end
local color = this.Gspot.color.fg
this.color = {color[1], color[2], color[3], this.alpha}
end
Re: Gspöt - formerly Yet another stateful GUI
Posted: Mon Mar 26, 2012 6:40 pm
by trubblegum
Gspot has had a major rewrite (thanks to some suggestions .. you know who you are). It should now be much more efficient, and a little easier to use.
The biggest change in functionality is that references are passed directly, so you no longer have to mess about with Gspot:element(id) and such tomfoolery.
I have been convinced that it was an unnecessary layer of abstraction which brought no real benefits.
Other changes include :
- type constructors are more flexible, as are many of elements' shiny new inherited methods
- element draw functions are now inherited from their element
- cascading element stylings, which are not yet working as expected
Other than that issue, which I'm working on, I think the whole thing runs a lot smoother.
Documentation is nearing completion over on the git wiki, and I'll be reworking the demo once that's done. It works, but it's way too cluttered.
I'll probably be moving the elements to individual includes, so you can cull the ones you don't want, and save some precious memory and deployment size. This will involve adding a conf.lua, similar to LÖVE's. Any objections?
Re: Gspöt - formerly Yet another stateful GUI
Posted: Thu Mar 29, 2012 7:02 pm
by trubblegum
Big commit today .. lots of optimization, granularization, and all kinds of other stuff that ends with "-ation"
- circle shapes, checkbox and feedback elements
- cascading element styling
- type operators
- improved drawing and boundary checking
etc
I'll get to updating the docs ASAP
Re: Gspöt - formerly Yet another stateful GUI
Posted: Fri Mar 30, 2012 9:32 pm
by SiENcE
I really like your GUI.
Im unsure to use Quickie or Gspöt. Hm...
Re: Gspöt - formerly Yet another stateful GUI
Posted: Fri Mar 30, 2012 11:12 pm
by trubblegum
They're very different breeds .. you would have to base your choice on what style of programming you prefer.
For sheer ease of use with simple interfaces, quickie probably has the goods. It also has the benefit of a developer who has more experience with Lua than I do.
It is very procedure-oriented, so you'll have to do state tracking yourself.
If you want to have your GUI around as an MCV style object, Gspot gives you direct access to persistent elements, but may take a little longer to learn the ins and outs of if you want to take full advantage of it.
There is also the possibility that, what with Gspot being the new kid, it still has undiscovered bugs. I'm pretty regular on the forum, so any you do find shouldn't take more than a day or so to set straight, but it's only fair to warn you that I've had no feedback on the current version, which in some ways differs greatly from the original.
Documentation is also out of date at the moment, but again, I'm accessible for questions, should they arise.
For a little background on the fundamental difference between the two libraries :
quickie works like this :
http://en.wikipedia.org/wiki/Immediate_mode
Gspot works like this :
http://en.wikipedia.org/wiki/Retained_mode
Hope that helps some. If anyone has experience, feel free to throw in your oar .. there are a lot of options around, so it can be a tough choice.
Re: Gspöt - formerly Yet another stateful GUI
Posted: Sat Mar 31, 2012 11:51 am
by SiENcE
Thanks for this infos.
I'm already using quickie, but I take a deeper look into yours.
Re: Gspöt - formerly Yet another stateful GUI
Posted: Fri May 04, 2012 10:28 am
by linux-man
Hi.
I can't make 2 scrollgroups to work. The first just disappear and all the elements are scrolled by the second. With the same parent or different parents.
Is it a bug?
Re: Gspöt - formerly Yet another stateful GUI
Posted: Wed Oct 17, 2012 9:06 am
by SiENcE
I swiched from Quickie to Gspöt. I use a lot of buttons and icons in my game and the fps drops a lot. I realized that Gspöt doesn't use spritebatch.
This should be improved.
btw. is there any other gui that uses spritebatch?
Re: Gspöt - formerly Yet another stateful GUI
Posted: Sun Oct 21, 2012 12:15 pm
by trubblegum
Spritebatch is kinda wacky, and I can't make sense of it, so it's unlikely to happen.
If the documentation improves to a point where you can actually tell what it does and how to do it, I might look at it.
I don't know about other GUI libs.
Apologies to the fellow with the scrollgroup problem .. I don't seem to be getting email notifications any more, so I'll check on my subscription settings.
Re: Gspöt - formerly Yet another stateful GUI
Posted: Fri Nov 30, 2012 7:11 am
by Karai17
G'day mate!
Awesome library!
I was wondering if there was an easy way to check which element has focus, or even better, to run a function when an element gains or loses focus?
Something like this:
Code: Select all
input = gui:input("text input", {x=0, y=0, w=48, h=16})
input.onFocus = function(this)
this:click()
end
input.click = function(this)
this.value = "focus/clicked!"
this:focus()
end
or maybe something similar to this:
Code: Select all
if gui.focus == input then -- note that gui.focus and input are not currently equal :(
input:click()
end
or even:
My goal is to have an element act the same, where it is focused by clicking or it is tabbed to using element.next.