rosancoderian Posted April 22, 2014 Share Posted April 22, 2014 i want to lock the orientation to potrait only, how to achieve this with phaser.js? Link to comment Share on other sites More sharing options...
ram64 Posted April 22, 2014 Share Posted April 22, 2014 I believe you can't lock the browser from switching to landscape mode but you can force the game to work only in a certain orientation and display a message to the user that he should switch to the correct orientation. You can see this example in the Full Screen Mobile Template in the Boot state. It uses the forceOrientation method of the ScaleManager to force the game in a certain orientation and displays a message to the user whenever the wrong orientation is entered using the enterIncorrectOrientation signal. Link to comment Share on other sites More sharing options...
nExt Posted April 22, 2014 Share Posted April 22, 2014 i using intel xdk to build app to mobile device .. so i using funtion function onDeviceReady(){....intel.xdk.device.setRotateOrientation("portrait");inte.xdk.device.setAutoRotate(false);... }document.addEventListener("intel.xdk.device.ready", onDeviceReady, false);////code game with phaser JS you can try it ... shohan4556 and spinnerbox 2 Link to comment Share on other sites More sharing options...
rosancoderian Posted April 22, 2014 Author Share Posted April 22, 2014 it seems that the game still can be resumed when enter the incorrect orientation, is that a bug? Link to comment Share on other sites More sharing options...
spinnerbox Posted May 25, 2015 Share Posted May 25, 2015 Yes as @next mentioned, it works on Intel XDK and the orientation is locked. Even if you minimize the app and the orientation gets to portrait, once you resume the app it will switch to landscape again and lock. I am talking about android. Link to comment Share on other sites More sharing options...
Recommended Posts