xxxxxxxxxx
// Create a new Scale Manager and set it to scale the game to the full width of the window
const scaleManager = new Phaser.Scale.ScaleManager(this, {
width: window.innerWidth,
height: window.innerHeight
});
// Set the Scale Manager to use the 'SHOW_ALL' scaling mode, which will scale the game
// while preserving its aspect ratio
scaleManager.scaleMode = Phaser.Scale.ScaleManager.SHOW_ALL;
// Set the min and max dimensions for the game
scaleManager.setMinMax(480, 260, 2048, 1536);
// Set the page alignment to center the game horizontally
scaleManager.pageAlignHorizontally = true;