3

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.

jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
  • No idea about what MonoGame is doing, but the alternative, [ExEn](http://andrewrussell.net/exen/), handles this just fine. It fully supports the `SupportedOrientations` setting on iOS. It will handle all the coordinate conversions internally (just like WP7). (Full disclosure: ExEn is my library.) – Andrew Russell Oct 21 '11 at 17:57
  • I'm going to contact at your email address on that link, I have a few questions about it. (There are definitely some issues with MonoGame that makes us consider a paid option) – jonathanpeppers Oct 21 '11 at 18:02

1 Answers1

4

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.

Dominique
  • 817
  • 1
  • 5
  • 10
  • I am using the source from GitHub. I just linked to their codeplex page, b/c it explains the project a little better. – jonathanpeppers Oct 22 '11 at 04:15
  • I have a theory I'll test tomorrow, I think it may work if you setup your app for Portrait only in Info.plist. I will test this out and let you know my results. – jonathanpeppers Oct 22 '11 at 04:17
  • Btw, most of the MonoGame developers hang out on the #MonoGame channel on the irc.gnome.org or irc.gimp.org. Even Miguel De Icaza pops in occasionally to ask how we are doing. – Dominique Oct 22 '11 at 14:41
  • Well setting Info.plist to portrait kind of worked. After rotating the simulator once, everything starts sizing and positioning correctly. But the app fires up with things resized wrong. I also noticed that using a double-tap gesture seems to cause the app to crash, although it works fine in the WP7 emulator in Windows. I'm going to look into getting on IRC and also try the MonoGame samples to see if they have similar issues. – jonathanpeppers Oct 22 '11 at 17:06
  • The MonoGame.Samples.TouchGesture sample has similar problems with gestures, doesn't seem to work quite right in the emulator or the device. I am upgrading to Lion, latest XCode, MonoTouch, etc. right now, which is only thing I can think of that might be a problem. Right now I have Snow Leopard, XCode 3.2.6, but latest MonoTouch/MonoDevelop. – jonathanpeppers Oct 22 '11 at 17:20
  • My Mac is updated, but I'm still having the same issues. I'll try to get on IRC. – jonathanpeppers Oct 24 '11 at 13:32