ScaleManager.orientationSprite has been removed because it never displayed correctly anyway (it would be distorted by the game scale), it will be bought back in a future version by way of a custom orientation state.

This commit is contained in:
photonstorm 2014-09-01 03:30:02 +01:00
parent 047839d806
commit 7fc37751b2
2 changed files with 4 additions and 46 deletions

View file

@ -134,6 +134,7 @@ Version 2.1.0 - "Cairhien" - -in development-
* Stage.checkOffsetInterval has been moved to ScaleManager.trackParentInterval
* ScaleManager.hasResized signal has been removed. Use ScaleManager.setResizeCallback instead.
* The World bounds can now be set to any size, including smaller than the game dimensions. Before it was locked to a minimum size of the game canvas, but it can now be anything.
* ScaleManager.orientationSprite has been removed because it never displayed correctly anyway (it would be distorted by the game scale), it will be bought back in a future version by way of a custom orientation state.
### Bug Fixes

View file

@ -95,11 +95,6 @@ Phaser.ScaleManager = function (game, width, height) {
*/
this.maxIterations = 5;
/**
* @property {PIXI.Sprite} orientationSprite - The Sprite that is optionally displayed if the browser enters an unsupported orientation.
*/
this.orientationSprite = null;
/**
* @property {Phaser.Signal} enterLandscape - The event that is dispatched when the browser enters landscape orientation having been in portrait.
*/
@ -548,49 +543,23 @@ Phaser.ScaleManager.prototype = {
/**
* If you need your game to run in only one orientation you can force that to happen.
* The optional orientationImage is displayed when the game is in the incorrect orientation.
*
* @method Phaser.ScaleManager#forceOrientation
* @param {boolean} forceLandscape - true if the game should run in landscape mode only.
* @param {boolean} [forcePortrait=false] - true if the game should run in portrait mode only.
* @param {string} [orientationImage=''] - The string of an image in the Phaser.Cache to display when this game is in the incorrect orientation.
*/
forceOrientation: function (forceLandscape, forcePortrait, orientationImage) {
forceOrientation: function (forceLandscape, forcePortrait) {
if (typeof forcePortrait === 'undefined') { forcePortrait = false; }
this.forceLandscape = forceLandscape;
this.forcePortrait = forcePortrait;
if (typeof orientationImage !== 'undefined')
{
if (orientationImage === null || this.game.cache.checkImageKey(orientationImage) === false)
{
orientationImage = '__default';
}
this.orientationSprite = new Phaser.Image(this.game, this.game.width / 2, this.game.height / 2, orientationImage);
this.orientationSprite.anchor.set(0.5);
this.checkOrientationState();
if (this.incorrectOrientation)
{
this.orientationSprite.visible = true;
this.game.world.visible = false;
}
else
{
this.orientationSprite.visible = false;
this.game.world.visible = true;
}
this.game.stage.addChild(this.orientationSprite);
}
},
/**
* Checks if the browser is in the correct orientation for your game (if forceLandscape or forcePortrait have been set)
*
* @method Phaser.ScaleManager#checkOrientationState
*/
checkOrientationState: function () {
@ -604,12 +573,6 @@ Phaser.ScaleManager.prototype = {
this.incorrectOrientation = false;
this.leaveIncorrectOrientation.dispatch();
if (this.orientationSprite)
{
this.orientationSprite.visible = false;
this.game.world.visible = true;
}
if (this.scaleMode !== Phaser.ScaleManager.NO_SCALE)
{
this.refresh();
@ -624,12 +587,6 @@ Phaser.ScaleManager.prototype = {
this.incorrectOrientation = true;
this.enterIncorrectOrientation.dispatch();
if (this.orientationSprite && this.orientationSprite.visible === false)
{
this.orientationSprite.visible = true;
this.game.world.visible = false;
}
if (this.scaleMode !== Phaser.ScaleManager.NO_SCALE)
{
this.refresh();