Hi, I used to do XNA development many years ago and I did a little bit with MonoGame about 2 years ago as well all on a Windows platform.
Recently, I got my first MacBook Pro and I decided to try getting my most recent project running again, with the interest of expanding on it. After fixing all of the obvious compilation issues and finally being able to run the game, I noticed right away that something was off. My mouse wasn’t interacting with my menu buttons because the Mouse class wasn’t returning the proper coordinates when I did a Mouse.GetState().Position (or .X or .Y).
After playing around with it for a while and Googling with no results, here is the information I can provide about the predicament:
- Coordinates returned by Mouse.GetState() are HALF of what they should be to be consistent with where things are drawn in the game. For example: when I expect the mouse to be at x=20, y=20, Mouse.GetState() will tell me it is at x=10, y=10.
- Calling Mouse.SetPosition(x, y); behaves as expected, placing the mouse where it is expected to be placed. This is really boggling to me, although, I don’t know how the underlying structure handles these calls…
- I have never faced this issue in my experience with MonoGame on Windows, XNA, or game development in general.
Does anybody have a clue what is going on here? I believe this is strictly a Mac OS X issue and may not even be related to MonoGame at all, but instead it may have to do with my display settings or something… Just to give a little more info, I’m developing using Xamarin Studio Community with the MonoGame Add-in.
Any help appreciated, thanks.