Löve Frames - A GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Discord
Prole
Posts: 8
Joined: Sat Dec 14, 2013 1:46 pm
Location: California
Contact:

Re: Löve Frames - A GUI Library

Post by Discord »

That's a great resource! Thanks for the link!
~D
~D I S C :monocle: R D
Ellina
Prole
Posts: 6
Joined: Wed Oct 23, 2013 4:08 pm

Re: Löve Frames - A GUI Library

Post 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 :)
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Löve Frames - A GUI Library

Post by Karai17 »

The order in which you draw things is important. Put loveframes.draw() as the very last line in your draw code.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Ellina
Prole
Posts: 6
Joined: Wed Oct 23, 2013 4:08 pm

Re: Löve Frames - A GUI Library

Post 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 =/
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post 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?
Ellina
Prole
Posts: 6
Joined: Wed Oct 23, 2013 4:08 pm

Re: Löve Frames - A GUI Library

Post 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 :)
Attachments
gameTest.love
(660.65 KiB) Downloaded 159 times
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post 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
Ellina
Prole
Posts: 6
Joined: Wed Oct 23, 2013 4:08 pm

Re: Löve Frames - A GUI Library

Post 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:
User avatar
qwook
Prole
Posts: 40
Joined: Fri Dec 13, 2013 5:53 am

Re: Löve Frames - A GUI Library

Post 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.
User avatar
MGinshe
Prole
Posts: 31
Joined: Sun Apr 17, 2011 3:50 am
Location: New Zealand

Re: Löve Frames - A GUI Library

Post 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 :)
Post Reply

Who is online

Users browsing this forum: No registered users and 88 guests