I am trying to make my first app using XNA, and I am having some issues with orientation and coordinates.
By default, my phone emulator is in portrait mode, but (0,0) is in the top right corner, and X and Y seem to be switched. from how I would expect them to be (x goes up, y goes across)
In my code, I try changing the orientation something similar to
SupportedOrientations = SupportedPageOrientation.Portrait;
SupportedOrientations.FullScreen = true;
And when I do this, it fixes the coordinate problems I am having, but then the screen becomes just a little square.
any ideas how to fix this? is this just how it is supposed to be?
Also, does orientation change automatically, or do I need to explicitly add
private void PhoneApplicationPage_OrientationChanging
(object sender,OrientationChangedEventArgs e)
Thanks
In addition to mandating the valid orientations, you should set your PreferredBackBufferWidth and PreferredBackBufferHeight appropriately (480 and 800, respectively, for current WP7). These are both found in the
graphicsmember of the main Game class. You don’t need to manually set the orientation.