Mamallan Posted May 3, 2017 Share Posted May 3, 2017 Hi, Any one please let me know how we can rotate the mobile screen to landscape when the game is opened. The game always should open in landscape view. if you are in portrait view and once you open the game your mobile screen automatically should rotate to landscape. Please anyone suggest on this. Link to comment Share on other sites More sharing options...
mattstyles Posted May 3, 2017 Share Posted May 3, 2017 You can't from the web. You'd have to do some awkward hack involving rotating the screen, which probably wouldn't work nicely. You can also detect screen dimensions and display a message asking the user to rotate their device, the only issue is that you only get the device orientation event after the screen has already rotated so its not absolutely ideal. If you throw your stuff into a native wrapper (like Cordova/Phonegap) you can lock orientation at device level. Link to comment Share on other sites More sharing options...
Alexalten Posted May 3, 2017 Share Posted May 3, 2017 Hi, You could use a little trick to "lock" the orientation: http://www.emanueleferonato.com/2015/04/23/how-to-lock-orientation-in-your-html5-responsive-game-using-phaser/ bye Link to comment Share on other sites More sharing options...
samme Posted May 3, 2017 Share Posted May 3, 2017 See phaser-ce/Phaser.ScaleManager.html#forceOrientation Link to comment Share on other sites More sharing options...
Recommended Posts