2
\$\begingroup\$

I am developing a game in which I need to rotate the screen on Landscape mode or Portrait, and lock it that way.

In Monogame, targeting Windows Phone 8.1 adding this code:

Graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
            Graphics.ApplyChanges();

Was enough, but in Monogame, targeting Windows Phone 8 I can switch from Portrait mode to Landscape, even if I put the code above in the game constructor.

How can I stop/freeze the user from chaning the orientations on a specific category in my game?

Thanks.

\$\endgroup\$
  • \$\begingroup\$ Does windows phone have an activity ? In android I use ScreenOrientation = ScreenOrientation.SensorLandscape; and it does what you describe. The user can rotate left/right keeping landscape mode at all times. I have no experience with windows phone unfortunately. \$\endgroup\$ – dimitris93 May 16 '15 at 19:02
-1
\$\begingroup\$

Go to your package manifest. There should be the options for screen orientation. Uncheck the portrait.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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