Jump to content

How to scale a game to fit different screen resolutions?


toto88x
 Share

Recommended Posts

Hello,

 

I'm starting to port one of my Phaser desktop game to smartphones. And I'd like to know how to make the game look great on different smartphones with different screen resolutions. I've seen this question a few time on this forum, but couldn't find a definite answer.

 

So let's try to make things simple with an example:

 

- The game is 800x500px in landscape. It's made with Phaser, and can use cocoonjs if it helps.

- The game should look great on an iPhone 5 (1136x640), and on a galaxy S3 (1280x720)

- The game should't be cropped

- The game should be fullscreen

- We can add black borders around the game to keep the original aspect ratio (or even better, extend the background of the game)

 

How would you do that? I have a hard time grasping everything related to stage.scale, stage.scaleMode, window.devicePixelRatio, window.innerWidth, etc.

 

Thanks for your help! :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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