XNA Mouse.GetState().Y Inaccurate on Multi Monitor Setup

I have a project built on top of MonoGame that rotates a sprite based on mouse cursor position. It works fine on Windows 10 and on my laptop monitor on OSX. However, on my secondary OSX monitor, the object is always facing mostly down as if the cursor’s Y coodinate was far below the screen.

I created a simple project to test the theory that the Y coordinate was incorrect. I found that the Y offset was not only incorrect, it appeared to be incorrect the exact amount of my primary monitor’s vertical offset from the secondary monitor. When I align my monitors along the top, the offset goes away. MonoGame must be calculating Y offsets from the primary monitor, even when running on the secondary monitor.

Note: My screenshots did not capture the mouse cursor so I’m simulating it’s position with a red dot.

Monitors aligned, entity and cursor are properly aligned:

Monitors offset, entity and cursor also offset:

Can you open an issue for this on GitHub? https://github.com/MonoGame/MonoGame/issues

Done.

I’m a new user and cannot post more links but it’s issue #5677

Thank you!

1 Like