Playmaker Forum

PlayMaker Help & Tips => Android Help => Topic started by: underoathgames on March 14, 2014, 01:08:15 AM

Title: Touch input, Long Press [SOLVED]
Post by: underoathgames 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.
Title: Re: Touch input, Long Press
Post by: jeanfabre 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
Title: Re: Touch input, Long Press
Post by: underoathgames 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.
Title: Re: Touch input, Long Press
Post by: jeanfabre 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