Jump to content

how to get "wrongorientation" image back in 2.1.1 ? also forceOrientation ?


valueerror
 Share

Recommended Posts

I never noticed this before, but yes, it isn't working like it was before.  Yes been through a load of stuff updating for webGL and now the orientation image is not showing.

 

I guess the image isn't showing because of this:

 

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.

 

 

Is there a way to just force the orientation to horizontal or portrait now though?

 

I've dropped the image from the parameters in false orientation but the screen still rotates on my iPad:

 

From this

this.scale.forceOrientation(true, false,'orientationImage');

to this:

  this.scale.forceOrientation(true);
Link to comment
Share on other sites

Looking at the docs there are some events and properties that could be used to manually show an incorrect orientation but as the forceOrientation seems not to be working at the moment, and a new orientate state is due, it may be more effort then its worth. I agree though, my games look better with a squidged orient image than a squashed game.

Hopefully this is just a bug not picked up when the scale mode changes were made as the image is not so important if the game can be locked to a good looking orientation.

Link to comment
Share on other sites

I've been looking at the phaser source for this both pre 2.1 and the current version.  Admittedly this is not a strength of mine, but it looks to me like setting forceOrientation never actually forced the display to remain landscape it just dispatches a signal to say that an incorrect landscape has been entered. This wouldn't usually be noticed because the old orientation image would appear and the world's visibility would be set to false. In the following code from the source of 2.05, if Phaser did detect an incorrect orientation it did nothing to the canvas it just hid it.  

 

I only ever used an orientation image so does anyone know if it is (ever was) possible to keep the orientation at landscape regardless of device orientation?

 

//Excerpt from scaleManager Phaser v2.05 if ((this.forceLandscape && window.innerWidth < window.innerHeight) || (this.forcePortrait && window.innerHeight < window.innerWidth))            {                //  Show orientation screen                this.incorrectOrientation = true;                this.enterIncorrectOrientation.dispatch();//******in 2.1 this block is removed as orientationSprite is no longer passed to scaleManager*******                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();                }
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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