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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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