mouse coordinates discrepancy?

For questions about using Classic.

Post » Sat Feb 28, 2009 5:43 am

Sorry if this is a known problem/feature/beaten topic, but I couldn't find anything about it in the wiki or the forums.
There seem to be some discrepancy between the mouse coordinates returned by system->get mouse X and the mouse cordinates used by then mouse/keyboard object.
The system event seems to be using the game window coordinates (0=left of game window) while the mouse/keyboard object seems to be using the whole screen coordinates (0=left of screen).
I think this is a good way of generating confusion, and why isn't there a setMouse X/y action in the system object in the first place, if there is a get mouse x/y?
If you can read the mouse position you should be also able to write it from the same object IMO.
B
3
S
1
G
3
Posts: 45
Reputation: 1,140

Post » Sun Mar 01, 2009 3:03 pm

It's deliberate, both are necessary. You want MouseX/MouseY for all the game stuff, and you need the screen coordinates for windowing code. What do you think we could rename them to to make this clearer?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Mon Mar 02, 2009 1:30 am

I think maybe ScreenMouseX/Y would be more appropriate.

It'd break existing caps with it though, would it not? (If the expression name is actually changed.)
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Mon Mar 02, 2009 2:11 am

I just noticed that I could get access to absmouseXY. That solves my problem
But I second the renaming, possibly to screenmouseX.
I hope it can be done without breaking older caps.
B
3
S
1
G
3
Posts: 45
Reputation: 1,140

Post » Mon Mar 02, 2009 8:27 am

displaymouseXY? Because display refers to the game window.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Mar 02, 2009 12:58 pm

Why not SystemMouse and GameMouse.

They can't be interpreted any other way with those names.
B
2
S
1
G
3
Posts: 105
Reputation: 1,310


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests