Jump to content

Game doesn't fit perfectly into landscape view on iPhone


royibernthal
 Share

Recommended Posts

My game fits perfectly into portrait view (when I don't force landscape view like I do in the code below), but on landscape view it's not perfect. Does it maybe have to do with the width/height ratio of the game?

 

Here's the relevant part of boot:

 

BootState.prototype.create = function(){game.stage.backgroundColor = 0xFFFFFF;game.input.maxPointers = 1;game.stage.disableVisibilityChange = true; //Disables pause when game loses focusgame.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;    game.scale.pageAlignHorizontally = true;    game.scale.pageAlignVertically = false;    if (!game.device.desktop){game.scale.setScreenSize(true);game.scale.forceOrientation(true, false, 'incorrectOrientation');game.scale.enterIncorrectOrientation.add(BootState.prototype.rescale, this);}game.state.start('preloader');}BootState.prototype.rescale = function(){var _this = this;    setTimeout(function(){      game.scale.orientationSprite.scale.set(game.width / game.scale.width, game.height / game.scale.height);    }, 100);}

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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