valueerror Posted September 21, 2014 Share Posted September 21, 2014 it seems i have overseen an important change in the scalemanager and i can't get it to work anymore.. my game rotates no matter what i do.. this wouldn't be that bad but.. the orientation image is not shown either thx in advance Link to comment Share on other sites More sharing options...
spencerTL Posted September 23, 2014 Share Posted September 23, 2014 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 thisthis.scale.forceOrientation(true, false,'orientationImage');to this: this.scale.forceOrientation(true); Link to comment Share on other sites More sharing options...
valueerror Posted September 23, 2014 Author Share Posted September 23, 2014 i tried different ways to force the orientation.. all are ignored.. it rotates despite my efforts and rescales the game - what looks really bad.. i'd rather have a distorted "donotrotate-image" than this Link to comment Share on other sites More sharing options...
spencerTL Posted September 23, 2014 Share Posted September 23, 2014 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 More sharing options...
spencerTL Posted September 24, 2014 Share Posted September 24, 2014 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 More sharing options...
Recommended Posts