Page 6 of 9

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Sun Apr 17, 2016 10:31 pm
by nyx
Hey, awesome! Sorry, all these answers are in the docs...

I am also wondering, how do you get SUIT to play nicely with love.graphics? I'm trying to draw images of my own and sometimes, calls to love.graphics.draw(image) or love.graphics.rectangle(etc, etc) or even love.printf() within SUIT do not actually draw the image.

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Mon Apr 18, 2016 2:08 am
by nyx
Just kidding, I figured it out. You have to call the love-related draw functions from within love.draw(). You can't call the draw functions from, say, love.update(). Probably need to learn love a little more, but hey.

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Sat Jun 04, 2016 8:39 pm
by Zarty55
nyx wrote:Just kidding, I figured it out. You have to call the love-related draw functions from within love.draw(). You can't call the draw functions from, say, love.update(). Probably need to learn love a little more, but hey.
I want to talk about this. Has anyone found a way to do this without having to separate your code into love.update and love.draw? Or am I doing something wrong?

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Sat Jun 04, 2016 10:45 pm
by alberto_lara
Zarty55 wrote:
nyx wrote:Just kidding, I figured it out. You have to call the love-related draw functions from within love.draw(). You can't call the draw functions from, say, love.update(). Probably need to learn love a little more, but hey.
I want to talk about this. Has anyone found a way to do this without having to separate your code into love.update and love.draw? Or am I doing something wrong?

As far as I know, "the rules" are these ones:

* You shall call drawing functions in love.draw() only

* You shall not try to draw things in love.update() or love.load(), this causes no errors but it has no effect

So, you can make calculations in love.draw() but, in order to have a more readable and modular code, you should draw in love.draw() and do the other stuff in love.update()

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Sat Jun 04, 2016 11:25 pm
by zorg
Those "rules" exist because of how [wiki]love.run[/wiki] is defined. With a bit of modification and understanding one could modify that behaviour, though it's really not recommended, for many a reasons.

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Tue Jun 07, 2016 4:53 pm
by alberto_lara
Correct, that's why I said "rules", with quotes :)

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Thu Jul 28, 2016 2:40 pm
by Germanunkol
Hi,
I'd like to use suit.anyHovered() in the love input callbacks (love.mousemoved, love.mousepressed ...), to check whether the input should go to what's beneath the GUI, or whether the GUI blocked the input.
However, in these functions, anyHovered is always false. I assume this is because love.update (where the suit layout is being generated) is called after the callbacks?

Is there a nice way to figure out if something howered over the GUI in the previous frame? (Of course, I could save suit.anyHovered into a global variable, but ugh.) Or do you recommend another way to do what I want?

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Mon Aug 08, 2016 2:09 pm
by alloyed
Germanunkol wrote:Hi,
I'd like to use suit.anyHovered() in the love input callbacks (love.mousemoved, love.mousepressed ...), to check whether the input should go to what's beneath the GUI, or whether the GUI blocked the input.
However, in these functions, anyHovered is always false. I assume this is because love.update (where the suit layout is being generated) is called after the callbacks?

Is there a nice way to figure out if something howered over the GUI in the previous frame? (Of course, I could save suit.anyHovered into a global variable, but ugh.) Or do you recommend another way to do what I want?
yep, the run loop looks like

* do events
* update (build suit state)
* draw (clear suit state)

so events happen in that void where the suit state is cleared. What I'm doing to work around this is by checking `suit.hovered_last` directly, which holds the hovered widget id as of the last frame, or nil if there's nothing being hovered over.

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Wed Sep 14, 2016 9:58 am
by Zireael
I am looking for a simple UI library capable of doing scrolling lists. Would you recommend SUIT?

Re: [Lib] SUIT - Simple User Interface Toolkit

Posted: Thu Sep 15, 2016 6:55 am
by Rishavs
If you dont want full sortable columns and otehr thingamajigs etc then its easy.

Create a msg_queue object.

start inserting all messages you want in the code in it.
create a var called wid_size where you define the number of messages to be shown.
(so if your msg_q obj has 1000 items and you only want to show the last 10 on each update)

then add two buttons and a slider in a horizontal layout (scrollbar)
when you click on the buttons or use the slider just keep changing the msgs range to be displayed.