kittykatattack / hexi

Make games the fun way!
MIT License
551 stars 83 forks source link

How to resize the canvas after a scene is over? #55

Open Mrkd007 opened 6 years ago

Mrkd007 commented 6 years ago

I tried changing the width but unfortunately, the extra width becomes black in color. so please help me out to resolve this as soon as possible.

JamesCraster commented 6 years ago

What do you mean by a scene? I've run into this problem, and I think I have a solution:

//In order to double the size of a 400x300 canvas after initialization: g.stage.scale.x = 2; g.stage.scale.y = 2, g.renderer.resize(800, 600);

Stuff may look blurry as it has been scaled up, so for pixel art games you'll need to set PIXI.SCALE_MODES.DEFAULT = PIXI.SCALE_MODES.NEAREST to maintain crispness.

Does this fix your issue?