Ziden Posted November 3, 2016 Share Posted November 3, 2016 Hello there. I'm making a simple game to understand phaser better. I have made a simple game using this resolution: phaserGame = new Phaser.Game(480, 720, Phaser.AUTO, ''); So, i can center this on screen etc. However, if i wish the game to be resized to fit the screen in desktop and mobile devices, what would be the best way to do ? Thanks again for any attention Link to comment Share on other sites More sharing options...
waechtertroll Posted November 4, 2016 Share Posted November 4, 2016 Well, the most easy solution is to let Phaser auto-scale it to use as much screen space as possible, by adding the following to your gamestate's preload function: this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; You can always read up on the Phaser ScaleManager documentation, experiment with other scaleMode constants and find which suits your needs most. Link to comment Share on other sites More sharing options...
Recommended Posts