Page 5 of 8

Re: Quickie [was: Immediate Mode Gui]

Posted: Mon Aug 20, 2012 8:16 am
by Roland_Yonaba
Hi,

Well I tried playing around with Quickie. And man, I had to say, you did a pretty impressive work on this.
I had some problems at first to get how the concept of IMGUIs. Didn't know about that. But reading at the code, and taking a look at the demo provided was actually very useful.

But I ran into a weird issue with the latest version of Quickie, (this commit).
For instance, let's create and draw some buttons.

Code: Select all

function love.load()
   Ui = require 'Quickie'
end

function love.update(dt)
   if Ui.Button ({text = "Button 1", pos = {150, 440}, size = {200, 50}}) then end
   if Ui.Button ({text = "Button 2", pos = {150, 500}, size ={200, 50}}) then end
   if Ui.Button ({text = "Button 3", pos = {450, 440}, size = {200, 50}}) then end
   if Ui.Button ({text = "Button 4", pos = {450,500}, size = {200,50}}) then end
end

function love.draw()
   Ui.core.draw()
end
Screenie...
Image
Here it is. I'm hovering at the fourth button, and the first one remains highlited, no matter what. :x
In other words, anytime I attempt to add some buttons, the first one keep staying in 'hot' mode, like if the mouse was permanently hovering it...

I did tried the same snippet with a previous version (let's say, this commit). I had to tweak a little the code to match with the API's demands.
From what I could see, the difference between this commit and the latest one (above) is the changes you brought to the API.
Some methods where deleted, among them gui.core.disableKeyFocus(). Fact is, with the previous version, the issue I mentionned above could be easily fixed, using gui.core.disableKeyFocus().

So what are the odds ?
I opened an issue on Github, by the way.
And once again, that's a brilliant piece of work.
No I'll probably go get some sleep.

Re: Quickie [was: Immediate Mode Gui]

Posted: Sat Dec 15, 2012 1:19 pm
by beforan
with the previous version, the issue I mentionned above could be easily fixed, using gui.core.disableKeyFocus().
I know this was some months ago now, but I've been using quickie this morning, and have discovered the equivalent in the latest version is gui.keyboard.disable() :)

Re: Quickie [was: Immediate Mode Gui]

Posted: Sat Dec 15, 2012 6:25 pm
by Roland_Yonaba
Hi Beforan, thanks for the feedback.
I've totally forgot to mention it, but yes, the issue was solved, as of this commit. That was since... 3 months ago.

Re: Quickie [was: Immediate Mode Gui]

Posted: Sun Dec 16, 2012 2:49 pm
by kikito
vrld wrote:
kikito wrote:Te new push/pop business and the repetition scream "DSL" to me
Not quite sure what you mean: What repetitions and how does that relate to DSLs?
I've just realized I never answered this question. The repetition I was referring to was the need of writing push and pop every time. I don't know if it still how things are done, but I'd rather have a single group method taking a function as parameter instead of two separate push and pop methods.

So, instead of this:

Code: Select all

function love.update(dt)
    gui.group.push{grow = 'right'}
        gui.Checkbox{info = music, size = {'tight'}}
        gui.Checkbox{info = sound, size = {'tight'}}
    gui.group.pop{}
end
This:

Code: Select all

function love.update(dt)
    gui.group({grow = 'right'}, function()
        gui.Checkbox{info = music, size = {'tight'}}
        gui.Checkbox{info = sound, size = {'tight'}}
    end)
 end
You probably do something like that already, since I've seen you doing something similar in hump.camera.

Re: Quickie [was: Immediate Mode Gui]

Posted: Tue May 21, 2013 7:08 pm
by zac503
So,

I'm working on my first Love2D game and this lib looks awesome. I've toyed around with it a bit and I'm finally understanding the general idea. I had a question though, Is there a way to change the graphics of the button elements? I'm doing a game with a pixel art feel and I was hoping I could update the buttons to match the general aesthetic of the game. Possibly load a preclick and click for the buttons?

Thanks!

Re: Quickie [was: Immediate Mode Gui]

Posted: Fri May 31, 2013 9:58 pm
by hryx
zac503 wrote:Is there a way to change the graphics of the button elements?
There sure is. Just edit style-default.lua (or create your own style file if you're feeling adventurous). All the actual widget drawing functions are in this file. In your case, edit the function Button().

Re: Quickie [was: Immediate Mode Gui]

Posted: Wed Nov 20, 2013 11:33 am
by riidom
Hi, I discovered a little bug in the text-input. When you are at beginning of text and press Backspace, it will duplicate the existing text instead of doing nothing.

in input.lua:49
change

Code: Select all

elseif keyboard.key == 'backspace' then
to

Code: Select all

elseif keyboard.key == 'backspace' and w.info.cursor > 0 then
and it is fixed, if I havent overseen any terrible consequences.

Another thing that bugs me a little, is that I cant type Umlauts there, I guess I have to expand the check for the code var, maybe with a table of allowed ones? If you are already on this vlrd, let me know, then I rather wait :)

Also Slider2D crashes when operated by arrowkeys, but I didnt look into this, since I probably will have rare use for it, just wanna mention.

Re: Quickie [was: Immediate Mode Gui]

Posted: Thu Nov 21, 2013 8:41 am
by vrld
riidom wrote:Hi, I discovered a little bug in the text-input. When you are at beginning of text and press Backspace, it will duplicate the existing text instead of doing nothing.
Will fix it soon...ish (the Umlaut-thing too). Thanks for reporting!
riidom wrote:Also Slider2D crashes when operated by arrowkeys
What do you mean by "crashes"?

Re: Quickie [was: Immediate Mode Gui]

Posted: Thu Nov 21, 2013 8:47 am
by riidom
Using your widget demo, I first click into the 2D Slider, to give it focus, then try to move the cross with cursor keys. On first keypress, I get:

Code: Select all

Error: Quickie/slider2d.lua:90: attempt to perform arithmetic on field 'x' (a nil value)
stack traceback:
	Quickie/slider2d.lua:90: in function 'Slider2D'
	main.lua:105: in function 'update'
	[string "boot.lua"]:407: in function <[string "boot.lua"]:373>
	[C]: in function 'xpcall'
When pressing up/down key, respective message for 'y'. Hope this helps!

Re: Quickie [was: Immediate Mode Gui]

Posted: Wed Nov 27, 2013 6:23 am
by riidom
Me again,
excuse double-posting, but this is quite another topic than the one before.
I made a multiline-textview-widget, see demo below. Actually, it is not a widget, and I could need a little help in wrapping things properly up so it fits in better.
So far it features textadjusting, gotta call that manually, since doing each frame would kill peformance (at least for me), and text doesnt change each frame anyway.
Then there is the draw and the mousewheel hook, but that's better to view in sourcecode.
Hope the code isnt too shitty, if it is, let me know why! :)
mlvtest.love
(22.43 KiB) Downloaded 252 times