MonoGame – Touch resolution issue in iOS

Encountered another issue similar to the ViewPort dimensions initialisation race-condition issue for iOS I blogged about previously. The fix was inspired by this discussion. The issue seems to date back to January.

22-08-2013 2-38-17 PM

The symptom is that touch events register are scaled up (or down) because the touch panel dimensions are not the same as the actual screen dimensions.

Not sure if this is 100% a bug because I can imagine a touch screen might sometimes have more or less resolution than a screen and when dealing direct with the hardware I have encountered this behaviour. The convenient solution is to start at the actual screen size by default.

I’ve resolved all of these race conditions by doing what I said I didn’t want to and placed a call to my engine initialisation code in Game::LoadContent();.

Some platforms seem to have the correct ViewPort after the call to Game::base.Initialize() while others seem to only work it out by Game::LoadContent();.

My experience with MonoGame is getting to the point where I almost feel up to creating a patch for this and the other issues but I see online discussions so I suspect that minds greater and more experienced than me are onto this.

For now they remain a TODO: as I have features to create.

Advertisements

About metawrap

CTO Massive Interactive. Ex Computer Whiz Kid - Now Grumpy Old Guru.
This entry was posted in MonoGame, TheGame. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s