Hello. If this question is solved somewhere else please point me to it, I didn't find it.
How do I change the screen orientation for when the user rotates the device? I'm making a game for which I only want to allow Landscape Left and Landscape Right.
Comments
First right click on the project in Gideros Studio, select properties and then select ios and choose autorotation for devices you want, usually iphone and ipad
Click ok
Then you you get it exported to xCode, simply select both landscape modes there
and it will autorotate only in these landscapes
you can try to implement it yourself, but it may be difficult and have some caveats
1) use accelerometer to and Application:getDeviceOrientation() to detect orientation changes
2) use centerly position sprite on the stage
3) rotate this sprite
but as I said, not the best way
we will be thinking on possible solutions on android about it further, to make them behave more as on ios
So, the solutions is: on the Android Manifest add sensorLandscape on screen orientation:
android:screenOrientation="sensorLandscape" =D