For mobile, is it possible to disable any auto orientation?

0 favourites
  • 14 posts
From the Asset Store
game inspired by auto chess , with soulslike combat
  • Hi everyone. Anyone knows if it is possible to disable auto orientations for mobile, either in c2 settings or cocoon?

    I'm not referring to just setting it to landscape or portrait, I mean lock the screen orientation entirely. So even if I flip it 180 degrees, it wont flip the screen and you will be looking at the screen upside down.

    Is this possible?

  • In project properties there is an Orientation field that you can set to portrait to lock it to portrait, landscape locks to landscape etc.

  • In project properties there is an Orientation field that you can set to portrait to lock it to portrait, landscape locks to landscape etc.

    No that won't work. I want it to lock the screen entirely, setting it to landscape or portrait and than flipping the phone 180 degrees will rotate the screen. I want it to remained locked.

  • bump

  • Try install this plugin and see if it works. https://github.com/apache/cordova-plugin-screen-orientation

  • Try install this plugin and see if it works. https://github.com/apache/cordova-plugin-screen-orientation

    Thanks, will download and give it a try

  • You can also edit the android_manifest.xml directly, and add (or change) in the activity node this:

    android:screenOrientation="portrait"

    or

    android:screenOrientation="landscape"

    this will lock the screen orientation for an android app.

  • Try install this plugin and see if it works. https://github.com/apache/cordova-plugin-screen-orientation

    Doesn't look like it's a plugin for c2. Not sure it's intended for which program.

  • You can also edit the android_manifest.xml directly, and add (or change) in the activity node this:

    android:screenOrientation="portrait"

    or

    android:screenOrientation="landscape"

    this will lock the screen orientation for an android app.

    Thanks, but will it still rotate between portrait modes if the phone is flipped 180 degrees?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • > Try install this plugin and see if it works. https://github.com/apache/cordova-plugin-screen-orientation

    >

    Doesn't look like it's a plugin for c2. Not sure it's intended for which program.

    I use the c2 official browser plugin to do

    Browser|lock orientation to primary portrait[/code:2z03yth0]
    Then add cordova-plugin-orientation (given Git) to your project. I have tested and it should lock your app to certain orientation even if you rotate 180 degrees.
    Make sure you set it to "primary"(normal screen position) or "secondary"(upside down) so it is locked.
  • FYI:

    "Thanks, but will it still rotate between portrait modes if the phone is flipped 180 degrees?,"

    Using the android_manifest.xml way above, will disable (ignore) any rotation from the user flipping the phone 180 degrees.

  • >

    > > Try install this plugin and see if it works. https://github.com/apache/cordova-plugin-screen-orientation

    > >

    >

    > Doesn't look like it's a plugin for c2. Not sure it's intended for which program.

    >

    I use the c2 official browser plugin to do

    Browser|lock orientation to primary portrait[/code:3g3i5kjj]
    Then add cordova-plugin-orientation (given Git) to your project. I have tested and it should lock your app to certain orientation even if you rotate 180 degrees.
    Make sure you set it to "primary"(normal screen position) or "secondary"(upside down) so it is locked.
    

    Thanks! That's really great. I'm travelling now, will try implement it once I'm back.

    Again, thank you, really appreciate it.

  • FYI:

    "Thanks, but will it still rotate between portrait modes if the phone is flipped 180 degrees?,"

    Using the android_manifest.xml way above, will disable (ignore) any rotation from the user flipping the phone 180 degrees.

    That method is also very useful. No need to wait for layout to get started. Thank you.

  • FYI:

    "Thanks, but will it still rotate between portrait modes if the phone is flipped 180 degrees?,"

    Using the android_manifest.xml way above, will disable (ignore) any rotation from the user flipping the phone 180 degrees.

    Thanks! Didn't saw your post earlier, sorry. Will definitely try this as well, always good to learn new techniques. Thank you again!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)