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

Get help using Construct 2

Post » Wed Sep 20, 2017 3:51 am

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?
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Wed Sep 20, 2017 4:38 pm

In project properties there is an Orientation field that you can set to portrait to lock it to portrait, landscape locks to landscape etc.
B
46
S
16
G
78
Posts: 2,168
Reputation: 46,353

Post » Thu Sep 21, 2017 2:11 am

plinkie wrote: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.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Fri Sep 22, 2017 2:09 pm

bump
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Sat Sep 23, 2017 9:43 am

Try install this plugin and see if it works. https://github.com/apache/cordova-plugin-screen-orientation
B
13
S
2
Posts: 31
Reputation: 699

Post » Sat Sep 23, 2017 1:54 pm

unicornspitfire wrote: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
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Sat Sep 23, 2017 11:06 pm

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.
B
9
S
4
Posts: 22
Reputation: 721

Post » Sun Sep 24, 2017 2:34 am

unicornspitfire wrote: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.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Sun Sep 24, 2017 2:35 am

htmlgames wrote: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?
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Sun Sep 24, 2017 7:24 am

rekjl wrote:
unicornspitfire wrote: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
Code: Select all
Browser|lock orientation to primary portrait

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.
B
13
S
2
Posts: 31
Reputation: 699

Next

Return to How do I....?

Who is online

Users browsing this forum: Darknessed, FabianB and 49 guests