Jump to content

Scaling for Mobile Devices


LuckieLordie
 Share

Recommended Posts

 Hi,

 

I've got a question about scaling on devices. I had a search before hand but I couldn't find anything that satisfied me so I'm making a new thread.

 

I'm trying to set up my game so that it will fill the screen on device and keep the aspect ratio I give it.

 

That means that I always create my Phaser.Game object with the same values no matter what device I put it on. For example: 

 

"var game = new Phaser.Game(1500, 800, Phaser.CANVAS, 'gameContainer');"

 

The problem lies when I try to use the game.scale object. The values I give it don't seem to stop it from stretching or squashing my screen.

 

Here is my Boot.js file. Hopefully you guys can help shed some light on it! :D

 

http://pastie.org/private/hfd4ylc0vvullkqccxteig

Link to comment
Share on other sites

If you pull from GIT you will get a folder with all the Phaser files / examples / assets. If you open '/resources/Project Templates/' you will find a folder called 'Full Screen Mobile' this should help you along the way (take a look in boot.js).

That being said, I am currently using the example in '/Basic' which works fine for me in most cases, however I seem to have some issues with the Galaxy Tab (although it works fine on the Galaxy S4)

Link to comment
Share on other sites

If you pull from GIT you will get a folder with all the Phaser files / examples / assets. If you open '/resources/Project Templates/' you will find a folder called 'Full Screen Mobile' this should help you along the way (take a look in boot.js).

That being said, I am currently using the example in '/Basic' which works fine for me in most cases, however I seem to have some issues with the Galaxy Tab (although it works fine on the Galaxy S4)

 

Yeah I've found full screen mobile but It doesn't seem to work for me. I put the CSS into my project and copied the Boot.js over but it still doesn't scale right. I could do with some info on how game.scale actually works.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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