WP 8.1 Portrait mode

Hi! I’m trying to port my portrait game on wp 8.1. I’m using 3.2 monogame and tried -pre version with NuGet.

I set only portrait mode in appxmanifest and add “graphics.SupportedOrientations = DisplayOrientation.Portrait;” in Game1(). But when I look at GraphicsDevice I see that Width and Height is 1920/1080 and it have to be other way around. So game is distorted like crazy because of this.

Is there any way to work with portrait mode properly on WP8.1?

I found out that changing resolution after game start is the solution in some sort. Just like this:

graphics.PreferredBackBufferWidth = 1080;
graphics.PreferredBackBufferHeight = 1920;


graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.Viewport.Height;
graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.Viewport.Width;

or if you want to do it in game1()

int tmp = graphics.PreferredBackBufferWidth;
graphics.PreferredBackBufferWidth = graphics.PreferredBackBufferHeight;
graphics.PreferredBackBufferHeight = tmp;

still I think there is better solution.

Hi MaxPirat

Thanks a bundle for sharing this workaround, works a charm! :smile: ould you also happen to know any way to detect the available screen space (size of menu/statusbars) ? :sunny:

Kind regards - Jakob