If I scale pixi viewport instead of pixi stage everything is working well. I mean If I change the resize method to this:
// Resize the viewport
this.viewport.resize(width, height);
// Resizing the game renderer/stage
this.renderer.resize(width, height);
// Scalign the stage to fit the window
this.viewport.scale.set(scale);
// Centering the stage
this.viewport.x = stageX;
this.viewport.y = stageY;
but I want to scale only pixi stage and I want to use pixi-viewport inside the scaled stage.
Is there any way to do this?
Hello,
I'm scaling the
pixi stage
following this approach.The code looks like:
The scaling is fine. The game fits on window on different resolutions but... The
pixi-viewport
does not working as expected.pixi-viewport
and the pointertap event on the button dosn't work.pixi-viewport
like drag, pinch and etc. are not working.This is how I initialize
pixi-viewport
:If I scale
pixi viewport
instead ofpixi stage
everything is working well. I mean If I change the resize method to this:but I want to scale only
pixi stage
and I want to usepixi-viewport
inside the scaled stage. Is there any way to do this?