*SOLVED* Too small screen resolution messes up mouse

Z

Zefyrinus

Guest
Note: I'm using GM 6.1. I know it's outdated, but because I started this game project using 6.1, I'm also going to finish it with it.

I started this project many years ago, so I have no idea why made this decision, but the size of the background/game room is 1080x540 px. The computer I have GM installed on has 1024x768 as its max resolution. Since the room is slightly smaller than the computer screen, it's rescaled a little bit, and this causes an odd problem: The bounding boxes of everything are offset. This causes no problems when you are steering your character with the keyboard; all collisions are still handled as they should.

But in this game there are some buttons that you need to click on with your mouse, and this is problematic because the bounding boxes of the buttons don't exactly match up with their sprites. Also, when I run the game in debug mode and hover the mouse over an instance, it's not the ID of the current instance I'm hovering over that's displayed, but the ID of whatever happens to be to left of the given instance.

I tried changing the room width to 1024 px, and everything was working fine. But if I'm going to change the size, then I need to rework my game background and reposition all instances and basically change every part of the code that refers to a given position in the game. So it's quite a bit of work. So my question is, is there no other solution that would let me keep my oddly sized background as is, or do I have no choice but to tediously change eeeeeeverything? (Scrolling mode is not a good idea when it's such a small difference in width (56 px) between the background and screen resolution.)

Even so, I wonder what happens if someone with a different screen resolution plays this game. Even if I change the room size to 1024x768, what happens if someone with a smaller or bigger screen plays it? Wouldn't that player also get problems trying to click the buttons with their mouse?
 
Top