Author Topic: fingertap and doubletap order  (Read 642 times)

Offline efreet

  • Recruit
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
fingertap and doubletap order
« on: 13 March, 2012, 12:00:22 AM »
Hi.
Is it possible to have OnFingerDoubleTap fire before OnFingerTap?
thanks

Offline William Ravaine

  • Administrator
  • Regular Poster
  • *****
  • Posts: 480
  • Karma: +21/-2
    • View Profile
    • Fatal Frog Software
Re: fingertap and doubletap order
« Reply #1 on: 13 March, 2012, 12:09:55 AM »
No, not out of the box. This wouldn't be too hard to implement yourself though, as you'd simply need to hold-off the single tap event and fire it when the double tap gesture recognizer fails (there' a state transition event you can register to on the GestureRecognizer class).

However, this raises some design issue because there's no good way of doing this AND having responsive single taps at the same time. The double tap gesture will generally fail by timing out while waiting for the second tap to land, and that involves a certain delay. This might be non-negligible depending on your context. If you don't care so much about having super responsive taps though, that could probably work well enough.

Offline efreet

  • Recruit
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: fingertap and doubletap order
« Reply #2 on: 13 March, 2012, 01:46:25 AM »
I had given that a go and yeah a little to delayed for the single tap.
thanks

Offline William Ravaine

  • Administrator
  • Regular Poster
  • *****
  • Posts: 480
  • Karma: +21/-2
    • View Profile
    • Fatal Frog Software
Re: fingertap and doubletap order
« Reply #3 on: 13 March, 2012, 01:27:28 PM »
I was also faced with this issue on a previous project of mine, and the best way to solve it is to actual avoid it :) As far as I know, there is no ideal solution for this due to the nature of the taps. This problem is best solved at the game design level.

Offline qholmes

  • FingerGesturer
  • Regular Poster
  • ****
  • Posts: 47
  • Karma: +0/-0
    • View Profile
    • Email
Re: fingertap and doubletap order
« Reply #4 on: 28 March, 2012, 07:33:13 PM »
This may be similar to what i am running into now and before actually.. Old version and new version i should say..

I use the Tool Box tools and i use a TBFingerDown and a TBTap on the same object.. I find that the Finger Down one sometimes eats the first tap and sometimes it does not.. So i switched the Tap to Double tap instead of Tap and now if you just use a triple tap then it works and i dont get misfires with a single tap.

Is there a better way to do this or not?

Q

Offline William Ravaine

  • Administrator
  • Regular Poster
  • *****
  • Posts: 480
  • Karma: +21/-2
    • View Profile
    • Fatal Frog Software
Re: fingertap and doubletap order
« Reply #5 on: 28 March, 2012, 08:02:06 PM »
If you want an event to happen before an other, you'll have to implement some kind of priority queue to handle this. But as I've said before, the single tap vs double tap scenario is quite tricky to handle, and it's better to avoid this situation all together, at the game design level.

Offline qholmes

  • FingerGesturer
  • Regular Poster
  • ****
  • Posts: 47
  • Karma: +0/-0
    • View Profile
    • Email
Re: fingertap and doubletap order
« Reply #6 on: 28 March, 2012, 08:07:50 PM »
Yes.. unfortunately i need to know when the finger is down on the iPad but also need to be able to click on the object to open it up.

Scenario...

I use a modified version of the Orbit camera to control the view
I use Finger down to do mouse over type control over a bunch of objects
I use Tap to open up an object.

Is there an obvious way i can make that work better?

The tricky part is the objects might not be obvious.. hence the mouse over behavior.. so once you are over an object that has a mouse over pop up and it is highlighted i just want and easy way to open up that object so i went with the double tap..

Q

Offline William Ravaine

  • Administrator
  • Regular Poster
  • *****
  • Posts: 480
  • Karma: +21/-2
    • View Profile
    • Fatal Frog Software
Re: fingertap and doubletap order
« Reply #7 on: 28 March, 2012, 08:14:43 PM »
You're after some quite advanced combinations here, and there's only so much you can do with the limited toolbox scripts.
There is a thread here on how to check if a finger is down, without using the FingerDown event. That might be useful to you.

Also, you could solve your problem in a different way, by having a little UI button popup when you "mouse-over" an object, instead of required a specific gesture. Just an idea :)

Offline qholmes

  • FingerGesturer
  • Regular Poster
  • ****
  • Posts: 47
  • Karma: +0/-0
    • View Profile
    • Email
Re: fingertap and doubletap order
« Reply #8 on: 28 March, 2012, 08:20:19 PM »
Yes i have learned the hard way that what i am doing is a bit more advanced... I was just fighting with it and realized that in my old versions i had disabled the drag object feature or actually put a radio button in for it... can i request that as a feature. I could not figure out why things would stop working but i was dragging my collision objects around.

Will look at the link later

Thanks

I tried the button pop up before and the client did not like it...

Q