Page 1 of 1

Handling resize event

Posted: Tue Jul 08, 2014 11:32 am
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

Re: Handling resize event

Posted: Tue Jul 08, 2014 11:44 am
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.

Re: Handling resize event

Posted: Tue Jul 08, 2014 11:59 am
by Robin
There is a callback for that, [wiki]love.resize[/wiki], that you can use like love.update, love.draw, love.keypressed, etc.

Re: Handling resize event

Posted: Wed Jul 09, 2014 7:24 pm
by soulaymenc
Thank you, that's what I needed :)