Hi to all.
I’m working on my first Monogame app, a W8.1/WP8.1 Universal app. I really like the almost magical way both platforms were supported without me doing anything, apart from the occasional compiler directive to cater for lack of hardware back button on the W8.1 target. I’m using the stable v3.4 version in VS2013 express.
However, I’m facing the following problem:
In the Win8.1 target, when the device is rotated, my TouchPanel.DisplayWidth and TouchPanel.DisplayHeight get reset to the actual screen size. However, I’m using a virtual screen of 1080x1920 so this messes up touch input.
This happens both on the Simulator and a Win8.1 tablet I have. It doesn’t happen on the Win Phone target.
My game is played in portrait mode, therefore I have defined this in the Package.appxmanifest for both targets and in my game1.cs LoadContent code, I set:
graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.PortraitDown
To cater for the difference between the actual screen size and the virtual screen size, as instructed by the Microsoft Virtual Academy Monogame tutorial (http://www.microsoftvirtualacademy.com/training-courses/creating-windows-phone-and-windows-store-games-with-monogame), I set:
TouchPanel.DisplayWidth = _drawState.ScreenBounds.Width;
TouchPanel.DisplayHeight = _drawState.ScreenBounds.Height;
(_drawState.ScreenBounds is a 1080x1920 Rectangle).