Get mouse position

New releases and general discussions.

Post » Thu Mar 20, 2008 9:29 pm

I would like to be able to retrieve the mouse X and Y position. You can get around it right now by creating an invisible object and give it the mouse movement.. but that seems quite unproffesional.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Thu Mar 20, 2008 9:31 pm

Use MouseX and MouseY
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Thu Mar 20, 2008 10:12 pm

That's the one... in the system object. MouseX(1), MouseX("My layer") etc gets mouse X for a specified layer too.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Mar 20, 2008 10:28 pm

Oh yes btw why its in the System Object and not in the Mouse & Keyboard object?
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Thu Mar 20, 2008 10:51 pm

Good point, that's caught a few people out. Next build has shortcuts to MouseX and MouseY in the Mouse & Keyboard object's expressions.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Mar 21, 2008 2:33 am

Oh nice! I looked in the mouse/keyboard object for it. That's why i didn't find it.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Fri Mar 21, 2008 9:40 am

Slightly off topic, but is there a way to change the X and Y of the mouse? As in, 'Set Mouse X' or 'Set Mouse Y'?
B
2
S
2
G
5
Posts: 108
Reputation: 1,866

Post » Fri Mar 21, 2008 2:29 pm

Not yet, I guess that's a logical addition to mouse & keyboard sometime soon as well :P
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests