separate single and double clicks?

Get help using Construct 2

Post » Sat Apr 01, 2017 9:47 am

I have 1 object and 2 menus. I want to make it so that when the player single clicks on the object then menu 1 is called and when they double click the same object menu 2 is called.

However It seems that when you double click it registers as a single click first regardless of speed.

I've tried ordering the events so the double click happens before the single click code and using a variable to disable menu 1 from being called in this case, but with clicks being "on" events they appear to trigger before the variable change.

There may be an easy solution i'm not seeing.

Any one have any ideas?

Thanks.
B
43
S
23
G
21
Posts: 735
Reputation: 12,132

Post » Sat Apr 01, 2017 11:10 am

@Ethan

You could use an instance variable to count clicks and use a timer so that after 0.25 seconds it checks how many clicks, opens the appropriate menu, and resets the variable to 0

Example .capx (r233)
Find all the Construct 2 games that were on Steam Greenlight here
B
36
S
10
G
7
Posts: 475
Reputation: 7,015

Post » Sat Apr 01, 2017 12:41 pm

@OddConfection Thanks for the example i'll take a look, but my worry is that if it doesnt appear instant then the pause might seem like lag.
B
43
S
23
G
21
Posts: 735
Reputation: 12,132

Post » Sat Apr 01, 2017 12:50 pm

@Ethan

No worries.

The delay is only a quarter of a second, which isn't very much at all.

You can shorten it if you want, it just needs to be long enough to do a double-click.
Find all the Construct 2 games that were on Steam Greenlight here
B
36
S
10
G
7
Posts: 475
Reputation: 7,015

Post » Sat Apr 01, 2017 12:58 pm

Yes i shortened it slightly and it work greats, thanks for your help.
B
43
S
23
G
21
Posts: 735
Reputation: 12,132


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests