Jump to content

How to lock the device orientation?


rosancoderian
 Share

Recommended Posts

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

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 ...

Link to comment
Share on other sites

  • 1 year later...
 Share

  • Recently Browsing   0 members

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