hexi icon indicating copy to clipboard operation
hexi copied to clipboard

How to resize the canvas after a scene is over?

Open Mrkd007 opened this issue 6 years ago • 1 comments

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.

Mrkd007 avatar Dec 11 '17 12:12 Mrkd007

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?

JamesCraster avatar Feb 14 '18 13:02 JamesCraster