That's a great resource! Thanks for the link!
~D
Löve Frames - A GUI Library
Re: Löve Frames - A GUI Library
~D I S C R D
Re: Löve Frames - A GUI Library
Hi there !
I'm using Löve Frames (GREAT library by the way ) 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
I'm using Löve Frames (GREAT library by the way ) 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
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é
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Löve Frames - A GUI Library
in my main.lua :Karai17 wrote:The order in which you draw things is important. Put loveframes.draw() as the very last line in your draw code.
Code: Select all
function love.draw()
Gamestate.draw()
if Gamestate.current == Game then
game:draw()
end
loveframes.draw()
end
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
Can you provide a .love file so we can take a look at your code?Ellina wrote:in my main.lua :Karai17 wrote:The order in which you draw things is important. Put loveframes.draw() as the very last line in your draw code.It can't be lower =/Code: Select all
function love.draw() Gamestate.draw() if Gamestate.current == Game then game:draw() end loveframes.draw() end
Re: Löve Frames - A GUI Library
Of course !Nikolai Resokav wrote:
Can you provide a .love file so we can take a look at your code?
Here it's my code
- Attachments
-
- gameTest.love
- (660.65 KiB) Downloaded 179 times
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
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
Indeed it works ! Thank you very muchNikolai 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
Re: Löve Frames - A GUI Library
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.
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
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 tooqwook 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.
Who is online
Users browsing this forum: No registered users and 5 guests