Package tripleplay.gesture
Class GestureDirector
java.lang.Object
react.Slot<Object>
playn.scene.Touch.Listener
tripleplay.gesture.GestureDirector
- All Implemented Interfaces:
react.Reactor.RListener
,react.SignalView.Listener<Object>
,react.ValueView.Listener<Object>
Resolves user touch input in terms of a set of
Gesture
s that are registered with this
director. May either be used as a standalone listener on a layer, or along with a set of other
regions in a given layer via GestureRegionDirector.
Will only consider touches that start within the defined bounds, but if it is given touch events
that end outside of the bounds, but started inside the bounds it will react to them.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a gesture to the set considered during each user interaction.react.ValueView<Gesture<?>>
void
onCancel
(Touch.Interaction iact) void
onEnd
(Touch.Interaction iact) void
onMove
(Touch.Interaction iact) void
onStart
(Touch.Interaction iact) int
Returns the number of milliseconds to wait after the last touch event to transition the current gestures to PAUSE.boolean
Removes the given gesture from the set considered during each user interaction.setPauseDelay
(int value) Sets the number of milliseconds to wait after the last touch even to transition the current guestures to PAUSE.boolean
boolean
trackingTouch
(Touch.Event touch) Methods inherited from class playn.scene.Touch.Listener
onEmit
Methods inherited from class react.Slot
andThen, compose, filtered, onChange
-
Field Details
-
bounds
public final pythagoras.f.IRectangle bounds
-
-
Constructor Details
-
GestureDirector
-
-
Method Details
-
add
Adds a gesture to the set considered during each user interaction. Returns this director for chaining. -
remove
Removes the given gesture from the set considered during each user interaction. Returns false if that gesture was not found. -
touchInBounds
-
trackingTouch
-
greedyGesture
-
pauseDelay
public int pauseDelay()Returns the number of milliseconds to wait after the last touch event to transition the current gestures to PAUSE. -
setPauseDelay
Sets the number of milliseconds to wait after the last touch even to transition the current guestures to PAUSE. The default is 500 (half a second).- Returns:
- this GestureDirector for call chaining.
-
onStart
- Overrides:
onStart
in classTouch.Listener
-
onMove
- Overrides:
onMove
in classTouch.Listener
-
onEnd
- Overrides:
onEnd
in classTouch.Listener
-
onCancel
- Overrides:
onCancel
in classTouch.Listener
-