rezoner / playground

Playground.js is a framework for your javascript based games. It gives you out-of-box access to essentials like mouse, keyboard, sound and well designed architecture that you can expand to your needs.
MIT License
466 stars 50 forks source link

Request: Resize function in states #29

Closed Nielsticot closed 8 years ago

Nielsticot commented 8 years ago

Hi, I just noticed that there is no resize function in states and I think it could be usefull. Please add it if you find it revelant and if you have enought time, thank you!

rezoner commented 8 years ago

Yes I do find it relevant, I don't know why it's not there :)

rezoner commented 8 years ago

So I have did a little investigation and resize event is being pushed down to the states. However the state must be already set when the resize event is called. So if you set the state in ready handler it will not get triggered for that state, because first resize is called right after create handler.

I can change that so there is another resize called after ready or when the state is entered for the first time.

Nielsticot commented 8 years ago

Ok, I just tested and it works, I think there is no need to change anything, thx.