cykod / Quintus

HTML5 Game Engine
http://html5quintus.com
GNU General Public License v2.0
1.41k stars 403 forks source link

Add/refine screen "resize" event #162

Open benpaddlejones opened 9 years ago

benpaddlejones commented 9 years ago

Once canvas is drawn a resize event does not retrigger redrawing of the canvas. Thus if the screen is rotated often the canvas is scaled out of view.

Maybe this is a solution: http://www.williammalone.com/articles/html5-game-scaling/

danielocdh commented 8 years ago

I was unsure how to solve this, what worked for me is to have this inside the callback on a jquery window resize event: Q.setup('canvas', {maximize: true});

Also you might need to manually adjust or override the width on the canvas container, because it is being set by quintus on the initial setup call, but not on resize setup calls.