Zoom With No Scale
Demonstrates how to enlarge a low-resolution game canvas using the zoom property while keeping the scale mode disabled.
160 × 144
class Example extends Phaser.Scene
{
preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
this.load.image('pic', 'assets/tests/zoom/title.png');
}
create ()
{
this.add.image(0, 0, 'pic').setOrigin(0);
}
}
const config = {
type: Phaser.AUTO,
backgroundColor: '#2dab2d',
scale: {
mode: Phaser.Scale.NONE,
parent: 'game-container',
width: 160,
height: 144,
zoom: 4
},
scene: Example
};
const game = new Phaser.Game(config);