Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mindfarm on August 29, 2014, 06:41:29 AM

Title: [Solved] Counting Mouseclicks / Doubleclick?
Post by: mindfarm on August 29, 2014, 06:41:29 AM
Hey,

how can I store the time between two mouseclicks to create a doubleclick event like described in this topic?

http://hutonggames.com/playmakerforum/index.php?topic=1721.msg7523#msg7523

I have no idea how to get this into int-variables. The comparing later is no problem, I just don't get the logic how to start.. Any help appreciated.
Title: Re: Counting Mouseclicks / Doubleclick?
Post by: jess84 on August 29, 2014, 07:17:04 AM
How about on your start state, have a get mouse down action, when click is detected go to state2  which has an Int Add (every frame, per second checked)  and another get mouse down action that transitions to state3. You could also have a Wait action set to a time you think is too slow for a double click and when that elapses, trigger a transition back to your start state.

then in state3 check the Int value for your given limit.

That's just off the top of my head. If you think about it in logical steps, there are probably a number of different ways of achieving it.

 
Title: Re: Counting Mouseclicks / Doubleclick?
Post by: szomaza on August 29, 2014, 07:19:24 AM
You could save the time at the first click with Get Time Info:
https://hutonggames.fogbugz.com/default.asp?W496

Then move onto another state where you wait for another click, save the same time, subtract and compare the result to your double click delay.

br,
szomaza
Title: Re: Counting Mouseclicks / Doubleclick?
Post by: mindfarm on August 29, 2014, 08:47:36 AM
Thank you both for helping.. still a lot to learn. ::)