Lock screen orientation

Get help using Construct 2

Post » Mon Oct 29, 2012 9:45 pm

Is there a way to prevent screen auto-orientation on HTML5 ? I have a prototype using Acceleration(X&Y)WithG and the native 'screen auto-rotate' constantly interfere.
B
4
Posts: 6
Reputation: 512

Post » Mon Oct 29, 2012 11:24 pm

There's no browser standard on this at the moment I'm afraid. However some other platforms (like appMobi, CocoonJS and Windows 8 apps) allow an orientation lock option in the export or publishing phase.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Mon Oct 29, 2012 11:38 pm

I haven't tried it, but you might be able to achieve this by checking the device's orientation by comparing if windowwidth>windowheight and change the layout angle accordingly.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Wed Oct 31, 2012 12:00 am

Well, its not a layout orientation pb only: when the screen rotate, the X & Y sensors become inverted. Really goofy stuff from the phone developers. Maybe they don't play games ?
B
4
Posts: 6
Reputation: 512

Post » Wed Oct 31, 2012 12:13 am

Hi Ashley,
I am a bit reluctant to dish out one licence for Construct 2 and another for Cocoon while prototyping. I may hit another snag further down...
Would someone -licensed- be kind enough to compile what I have done so far ? Christmas is coming soon,right ?
B
4
Posts: 6
Reputation: 512

Post » Tue May 21, 2013 11:14 am

Hello, if you're using Phonegap this might be useful:

https://github.com/cogitor/PhoneGap-OrientationLock

Construct creates some javascript files when you export to Phonegap, but since I have no knowledge of javascript I don't know where(there's several files) you're supposed to paste that code.

If anyone could clarify that to me it'd be great. Hope it helps, and hope you help me too
B
3
Posts: 11
Reputation: 372

Post » Mon Nov 30, 2015 6:31 am

hello
my game is potrate view game but there is some problem , the problem is when i flip my phone to horizontal.Game also flip in horizontal mode . i want to lock my game in potrate mode . please send me the link . or solution
B
4
Posts: 5
Reputation: 222

Post » Mon Nov 30, 2015 8:12 am

how to stop auto rotation, in final apk
B
4
Posts: 5
Reputation: 222


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], Rezzon71, tarek2 and 22 guests