Handling resize event

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
soulaymenc
Prole
Posts: 36
Joined: Thu Jul 11, 2013 2:03 pm
Contact:

Handling resize event

Post by soulaymenc »

Hello folks,
:emo:
I have been struggling to find a proper way to handle screen resize event. What I have done already is to check if the width and height of the window have been changed, in love.update(dt). I'm sure there is a better way to do it. :x
This world is so strange.
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Handling resize event

Post by Jeeper »

soulaymenc wrote:Hello folks,
:emo:
I have been struggling to find a proper way to handle screen resize event. What I have done already is to check if the width and height of the window have been changed, in love.update(dt). I'm sure there is a better way to do it. :x
I am not 100% sure I understand what the problem is. But you could do whatever you want to do based on the player changing something in the options. So rather than checking if the screen size has changed, you trigger your thing the moment the player presses the button that activates the change.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Handling resize event

Post by Robin »

There is a callback for that, [wiki]love.resize[/wiki], that you can use like love.update, love.draw, love.keypressed, etc.
Help us help you: attach a .love.
User avatar
soulaymenc
Prole
Posts: 36
Joined: Thu Jul 11, 2013 2:03 pm
Contact:

Re: Handling resize event

Post by soulaymenc »

Thank you, that's what I needed :)
This world is so strange.
Post Reply

Who is online

Users browsing this forum: No registered users and 58 guests