I’m calling the following:
this.scale.on('resize', this.handlerScene.resize, this);
In each scene I need to, to automatically adjust the size of the game screen, physics, and canvas - and it works great… However sprites and images get stretched out or otherwise distorted depending on how the screen size changes. How can I make sure all sprites and other images are no longer distorted when I resize the screen?
The resize function:
resize(scene) {
this.scale.setGameSize(window.innerWidth, window.innerHeight);
this.physics.world.setBounds(0, 0, window.innerWidth, window.innerHeight);
this.scale.updateScale();
}
If I use Phaser.Scale.RESIZE, then this.psychics.world.setBounds() doesn’t affect anything.