Package tripleplay.util
Class DoubleTapper
java.lang.Object
react.Slot<Object>
playn.scene.Pointer.Listener
tripleplay.util.Tapper
tripleplay.util.DoubleTapper
- All Implemented Interfaces:
react.Reactor.RListener
,react.SignalView.Listener<Object>
,react.ValueView.Listener<Object>
Detects double taps on a layer, using a threshold time between taps. Two taps that occur
within a time span shorter than the threshold are considered a double tap.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Maximum time between taps for the 2nd to be considered a double.Fields inherited from class tripleplay.util.Tapper
DEFAULT_TAP_DIST, DEFAULT_TAP_DIST_SQ, maxTapDistSq
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when a double tap occurs.void
onDoubleTap
(Event.XY where) Called when a double tap occurs.void
Called when a tap occurs.Methods inherited from class playn.scene.Pointer.Listener
onEmit
Methods inherited from class react.Slot
andThen, compose, filtered, onChange
-
Field Details
-
DOUBLE_TIME
public static final double DOUBLE_TIMEMaximum time between taps for the 2nd to be considered a double.- See Also:
-
-
Constructor Details
-
DoubleTapper
public DoubleTapper()
-
-
Method Details
-
onTap
Description copied from class:Tapper
Called when a tap occurs. By default, this just callsTapper.onTap()
. Subclasses overriding needn't call super. -
onDoubleTap
public void onDoubleTap()Called when a double tap occurs. This is a simpler version ofonDoubleTap(Event.XY)
, for subclasses that don't require the event position. -
onDoubleTap
Called when a double tap occurs. By default, this just callsonDoubleTap()
. Subclasses overriding this needn't call super.- Parameters:
where
- the pointer's end position (for the 2nd tap)
-