Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am building a game in LibGDX and the game screen orientation is in landscape. I want it to stay in landscape but I still want the user to be able to flip the device onto the other side and the screen will rotate with it. My application refuses to do that and I don't know what to do to fix that. I tried turning on my accelerometer and compass (wasn't expecting anything from compass) but nothing changed. Any ideas?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

It defaults to locked on "landscape" mode in a libGDX project. You need to go into your "AndroidManifest.xml" and change android:screenOrientation="landscape" too android:screenOrientation="sensorLandscape"

There are more options - http://developer.android.com/guide/topics/manifest/activity-element.html#screen Just replace "sensorLandScape" with the one you want.

share|improve this answer
1  
But I don't want it to switch to portrait but I do want it to switch sides. So if you have your device on one side the screen will stay the same but if want it on another side BUT still landscape it will switch to the other side. –  G3tinmybelly Mar 31 at 20:16
    
OOO my bad, add "reverseLandscape" I think –  Krtko Mar 31 at 20:17
    
just FYI, developer.android.com/guide/topics/manifest/… –  Krtko Mar 31 at 20:19
    
reading the docs there, i think you need "sensorLandscape" –  Krtko Mar 31 at 20:20
1  
Thank you very much that did the job! –  G3tinmybelly Mar 31 at 20:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.