ChrisNeedham24 / microcosm

A little 4X game written using Pyxel.
GNU General Public License v3.0
9 stars 8 forks source link

Investigate multi-monitor issues #126

Open ChrisNeedham24 opened 1 year ago

ChrisNeedham24 commented 1 year ago

I have noticed that when playing the game on a second monitor, clicking does not work. It would be worth looking into whether this is just a limitation of the pyxel library, or whether there's something we can do about it.

I had a cursory look at this and it seems like the pyxel.mouse_x value is wildly negative, like -400. The pyxel.mouse_y value seemed to be reasonable, though.

Could we detect whether multiple monitors are in use or if the game is running on a second monitor? Could we modify the mouse x value somehow?

ChrisNeedham24 commented 11 months ago

An easy way of doing this could potentially simply be detecting if the pyxel.mouse_x value is negative and displaying a warning instructing the user to play on their primary monitor. Of course, ideally we fix the bug, assuming it's not just a limitation of pyxel itself.