Jump to content

Best way to resize for mobile


Ziden
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...