Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / A problem with SetOrientationAllowed() in AGK v2 (alpha 8)

Author
Message
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 29th Oct 2014 00:10
I think something is broken with the command SetOrientationAllowed()

It works as expected when I set it to allow it to orientate either in Portrait 1 or Portrait 2; but when I try and set it to allow both orientations, then it only stays in Portrait 1 regardless of which way up the device faces.



It seems to work ok however, when I do the same thing with Landscape 1 and 2.

Has anyone else noticed this? Or am I doing something wrong?

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th Oct 2014 02:54
Check the AndroidManifest.xml in your Eclipse project. It should be set to

android:screenOrientation="sensorPortrait"

Wherever you see that type of setting.
Note that some phones will not allow inverted portrait at all...

=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 30th Oct 2014 00:30
Thanks Naphier, but I currently don't have eclipse installed or set up, instead I rely on the TGC's online apk compiler (or more recently the offline one included with v2)

It also doesn't really explain why it's only the 1 mode which seems to have problems?

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 30th Oct 2014 00:46
I imagine the issue is that Paul only has the manifest set to "portrait" instead of "sensorPortrait". It looks like the options in the IDE exporter are only full rotation, portrait, and landscape. There should be more options, I'm sure he'll add them in later if asked.
The AppGameKit command gets overwritten by the android manifest. Similar issues happen with iOS, you have to go into the code and make sure things are correct for your orientations because SetOrientationAllowed will be overridden by the code.

If you really want to have this done and don't want to tinker with Eclipse then I can help you. I've been offering publishing services for a while and a few AppGameKit users have used me to do this. I would also help you with things like making sure the app appears on the store as "made for tablets" when people are looking at the app from a tablet device. Similarly it would show as made for phones when browsing the store with a phone. Just shoot me an email and we can discuss further.

Login to post a reply

Server time is: 2024-04-26 20:15:47
Your offset time is: 2024-04-26 20:15:47