Page 18 of 41

Re: Löve Frames - A GUI Library

Posted: Sun Jan 26, 2014 3:39 pm
by Discord
That's a great resource! Thanks for the link!
~D

Re: Löve Frames - A GUI Library

Posted: Wed Feb 12, 2014 3:05 am
by Ellina
Hi there !

I'm using Löve Frames (GREAT library by the way :awesome: ) for my game and I have problems with layers.
I explain myself : I have two gamestates, the first one is my game and the other one is the pause menu.
When the pause occur (P is pressed), I simply set a panel on visible(true) and modal(true) so the player can see the map but nothing is moving.
The problem is that the panel is drawn under the map which my game drawn with love.graphics.draw().

How can I make it upper it and not under ?

Thanks :)

Re: Löve Frames - A GUI Library

Posted: Wed Feb 12, 2014 3:31 am
by Karai17
The order in which you draw things is important. Put loveframes.draw() as the very last line in your draw code.

Re: Löve Frames - A GUI Library

Posted: Wed Feb 12, 2014 3:38 am
by Ellina
Karai17 wrote:The order in which you draw things is important. Put loveframes.draw() as the very last line in your draw code.
in my main.lua :

Code: Select all

function love.draw()
	Gamestate.draw()
    if Gamestate.current == Game then
        game:draw()
    end
    loveframes.draw()
end
It can't be lower =/

Re: Löve Frames - A GUI Library

Posted: Wed Feb 12, 2014 8:42 am
by Nikolai Resokav
Ellina wrote:
Karai17 wrote:The order in which you draw things is important. Put loveframes.draw() as the very last line in your draw code.
in my main.lua :

Code: Select all

function love.draw()
	Gamestate.draw()
    if Gamestate.current == Game then
        game:draw()
    end
    loveframes.draw()
end
It can't be lower =/
Can you provide a .love file so we can take a look at your code?

Re: Löve Frames - A GUI Library

Posted: Wed Feb 12, 2014 9:02 am
by Ellina
Nikolai Resokav wrote:
Can you provide a .love file so we can take a look at your code?
Of course !
Here it's my code :)

Re: Löve Frames - A GUI Library

Posted: Wed Feb 12, 2014 9:24 am
by Nikolai Resokav
Ok, the drawing seems to work correctly if you move loveframes.draw() to your GameClass:draw() function in Game.lua:

Code: Select all

function GameClass:draw()
    self.map:draw()
	loveframes.draw()
end

Re: Löve Frames - A GUI Library

Posted: Wed Feb 12, 2014 9:36 am
by Ellina
Nikolai Resokav wrote:Ok, the drawing seems to work correctly if you move loveframes.draw() to your GameClass:draw() function in Game.lua:

Code: Select all

function GameClass:draw()
    self.map:draw()
	loveframes.draw()
end
Indeed it works ! Thank you very much :awesome:

Re: Löve Frames - A GUI Library

Posted: Thu Feb 20, 2014 2:47 am
by qwook
I don't think your state handling is quite proper.
Each individual component class should not have to include the state checking code in them. The state machine should decide whether or not to render something or give it input.

You also shouldn't be handling overflow with stencils, but with scissors. You should be using a scissor stack to handle each of the children panels.

Creating custom components is also a bit of a hassle.

Re: Löve Frames - A GUI Library

Posted: Sun Feb 23, 2014 10:40 am
by MGinshe
qwook wrote:I don't think your state handling is quite proper.
Each individual component class should not have to include the state checking code in them. The state machine should decide whether or not to render something or give it input.

You also shouldn't be handling overflow with stencils, but with scissors. You should be using a scissor stack to handle each of the children panels.

Creating custom components is also a bit of a hassle.
both of those things are very, very easy to fix. i'm not sure how active this project is, but i definitely think it could do with an update. more skins would be pretty awesome too :)