playMaker

Author Topic: [Solved] Counting Mouseclicks / Doubleclick?  (Read 1976 times)

mindfarm

  • Playmaker Newbie
  • *
  • Posts: 7
[Solved] Counting Mouseclicks / Doubleclick?
« 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.
« Last Edit: August 29, 2014, 08:48:02 AM by mindfarm »

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Counting Mouseclicks / Doubleclick?
« Reply #1 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.

 

szomaza

  • Sr. Member
  • ****
  • Posts: 253
Re: Counting Mouseclicks / Doubleclick?
« Reply #2 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

mindfarm

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Counting Mouseclicks / Doubleclick?
« Reply #3 on: August 29, 2014, 08:47:36 AM »
Thank you both for helping.. still a lot to learn. ::)