How do I detect the mouse's x click?

Get help using Construct 2

Post » Sun Jun 17, 2012 6:41 pm

I have added the mouse object to my game. I would like to know if i can obtain the click's x position in a condition somehow. I have tried all the screens to no avail. I want to perform some action if the user clicks to the left side of the screen and another if he clicks to the right. Any assistance would be greatly appreciated.

Sincerely,

Yeti Kart Racer
B
10
S
1
G
1
Posts: 14
Reputation: 761

Post » Sun Jun 17, 2012 6:52 pm

you can make 2 sprite (red,blue) one in the left and other in right if mouse clicked on red it do something , and blue do something else but if you want right and left click of an object this is something different...
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Sun Jun 17, 2012 8:49 pm

Add a condition 'System -> Compare two values' and input 'Mouse.X > WindowWidth/2'.

Quick example: LeftRightScreen.capx (r95)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Mon Jun 18, 2012 1:40 am

[QUOTE=Nimtrix] Add a condition 'System -> Compare two values' and input 'Mouse.X > WindowWidth/2'.

Quick example: LeftRightScreen.capx (r95)[/QUOTE]
Thanks, this is exactly what i was looking for.

Sincerely,

Yeti Kart Racer
B
10
S
1
G
1
Posts: 14
Reputation: 761


Return to How do I....?

Who is online

Users browsing this forum: sekocit and 28 guests