Class: SC.TapGesture
Extends
SC.Gesture.
Defined in: tap_gesture.js
Field Summary
Instance Methods
- touchAddedToSession(touch, touchesInSession)
- touchCancelledInSession(touch, touchesInSession)
- touchEndedInSession(touch, touchesInSession)
- touchesMovedInSession(touchesInSession)
- touchSessionCancelled()
- touchSessionEnded()
- touchSessionStarted(touch)
Field Detail
name String- Default value:
- "tap"
The amount of time in milliseconds between when the first touch starts and the last touch ends that should be considered a short enough time to constitute a tap.
- Default value:
- 250
The amount of time in milliseconds after the first touch starts at which, if the tap hasn't
ended in that time, the tapStart
event should trigger.
Because taps may be very short or because movement of the touch may invalidate a tap gesture entirely, you generally won't want to update the state of the view immediately when a touch starts.
- Default value:
- 150
The number of pixels that a touch may move before it will no longer be considered a tap. If any of the touches move more than this amount, the gesture will give up.
- Default value:
- 10
The number of milliseconds that touches must start and end together in in order to be considered a tap. If the touches start too far apart in time or end too far apart in time based on this value, the gesture will give up.
- Default value:
- 75
Instance Method Detail
The tap gesture only remains interested in a touch session as long as none of the touches have
started too long after the first touch (value of touchUnityDelay
). Once any touch has started
too late, the tap gesture gives up for the entire touch session and won't attempt to re-engage
(i.e. even if an extra touch "taps" cleanly in the same touch session, it won't trigger any
further tap callbacks).
- Parameters:
- touch SC.Touch
- The touch to be added to the session.
- touchesInSession Array
- The touches already in the session.
- Returns:
- Boolean
- True as long as the new touch doesn't start too late after the first touch.
- See:
- SC.Gesture#touchAddedToSession
- Parameters:
- touch SC.Touch
- The touch to be removed from the session.
- touchesInSession Array
- The touches in the session.
- Returns:
- Boolean
- True
- See:
- SC.Gesture#touchCancelledInSession
The tap gesture only remains interested in a touch session as long as none of the touches have
ended too long after the first touch ends (value of touchUnityDelay
). Once any touch has ended
too late, the tap gesture gives up for the entire touch session and won't attempt to re-engage
(i.e. even if an extra touch "taps" cleanly in the same touch session, it won't trigger any
further tap callbacks).
- Parameters:
- touch SC.Touch
- The touch to be removed from the session.
- touchesInSession Array
- The touches in the session.
- Returns:
- Boolean
- True if it is the first touch to end or a subsequent touch that ends not too long after the first touch ended.
- See:
- SC.Gesture#touchEndedInSession
The tap gesture only remains interested in a touch session as long as none of the touches have
moved too far (value of tapWiggle
). Once any touch has moved too far, the tap gesture gives
up for the entire touch session and won't attempt to re-engage (i.e. even if an extra touch
"taps" cleanly in the same touch session, it won't trigger any further tap callbacks).
- Parameters:
- touchesInSession Array
- All touches in the session.
- Returns:
- Boolean
- True as long as none of the touches have moved too far to be a clean tap.
- See:
- SC.Gesture#touchesMovedInSession
- Returns:
- void
- See:
- SC.Gesture#touchSessionCancelled
- Returns:
- void
- See:
- SC.Gesture#touchSessionEnded
- Parameters:
- touch SC.Touch
- The touch that started the session.
- Returns:
- void
- See:
- SC.Gesture#touchSessionStarted