playMaker

Author Topic: Touch input, Long Press [SOLVED]  (Read 4951 times)

underoathgames

  • Playmaker Newbie
  • *
  • Posts: 2
    • Underoath Games
Touch input, Long Press [SOLVED]
« on: March 14, 2014, 01:08:15 AM »
Hi, I've searched the forums but I can't seem to find any help on how to correctly perform a "long press" using playmaker for mobile.  I've tried storing the Delta Time and triggering off that but the event is not sent until I lift my finger.  I want the event to trigger after 2 seconds while my finger is still holding down.  Any help would be greatly appreciated.  Thanks.
« Last Edit: March 19, 2014, 05:54:03 PM by underoathgames »
There are 10 types of people in the world, those that understand binary and those that don't.

http://www.underoathgames.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Touch input, Long Press
« Reply #1 on: March 14, 2014, 07:11:20 AM »
Hi,

 when you detect a mouse start, straight away send en event with a delay of 2 seconds, if you catch that event before the touch is canceled or stopped then you have your long pause.

 be carefull delayed events are always firing even if you leave the state, prefer using this action:

http://hutonggames.com/playmakerforum/index.php?topic=1249.msg5245#msg5245


else, go for input.touch, it's all implement for you and much more.

https://hutonggames.fogbugz.com/default.asp?W961

bye,

 Jean

underoathgames

  • Playmaker Newbie
  • *
  • Posts: 2
    • Underoath Games
Re: Touch input, Long Press
« Reply #2 on: March 14, 2014, 07:14:35 PM »
Hi Jean,
Thanks for the help.  In fact I was able to use the send event with delay method with success because there is a Kill Delayed Events action that worked perfectly.  So once I captured the press, I trigger the send event with 2 second delay.  If the user lifts his finger before the 2 seconds then I will send Kill Delayed Events action, otherwise I will send to the next state.  I can send a picture of the FSM is you're interested but I can't figure out how to embed an image in this forum.
There are 10 types of people in the world, those that understand binary and those that don't.

http://www.underoathgames.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Touch input, Long Press
« Reply #3 on: March 18, 2014, 09:14:56 AM »
Hi,

 it's ok. The image has to be online already, or you add it as an attachement and it will show up as well.

bye,

 Jean