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.
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
Thanks, will download and give it a try
Develop games in your browser. Powerful, performant & highly capable.
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.
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 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.
> Try install this plugin and see if it works. https://github.com/apache/cordova-plugin-screen-orientation
>
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.
> > 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.
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.
Thanks! Didn't saw your post earlier, sorry. Will definitely try this as well, always good to learn new techniques. Thank you again!