简体   繁体   中英

MonoGame and MonoTouch on iOS - Landscape Orientation

We are using MonoGame to develop for iOS and Windows Phone 7 (and then eventually Android).

Our game runs only in landscape orientation.

If running in the WP7 emulator on windows, our graphics device setup like so, in Initialize() in our Game:

graphics = new GraphicsManager(this);
graphics.PreferredBackBufferWidth = 480;
graphics.PreferredBackBufferHeight = 320;
graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;

This isn't the exact screen size for WP7 (we have a black bar on the right for now, which is not our primary concern), but gives us the right screen size that will run on an iPhone. For everything to look correctly on the iPhone, we have to reverse the Width and Height of the backbuffer, which seems very strange.

We also find we have to reverse any X/Y coordinates and Widths/Heights throughout our game.

This is a lot of trouble to deal with. What exactly is MonoGame doing here?

What is the recommended for us to handle the apparent resizing between these 2 platforms? We would like to somehow use the same coordinates across the board if possible.

EDIT: The latest 2.0 version of MonoGame on GitHub no longer has the orientation issues.

TouchPanel gestures are not quite implemented yet, so we are just avoiding that.

You seem to be using to the old MonoGame sources on codeplex, that ExEn actually forked from and went commercial with. The latest OpenSource MonoGame source and proper home page is https://github.com/mono/MonoGame .

Could you please try the source version from there, and let me know if this is still an issue. We are gearing up for release v1.6 of MonoGame and I'd like to have this fixed, if it is still an issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM