Package tripleplay.gesture
Class GestureRegionDirector
java.lang.Object
react.Slot<Object>
playn.scene.Touch.Listener
tripleplay.gesture.GestureRegionDirector
- All Implemented Interfaces:
react.Reactor.RListener
,react.SignalView.Listener<Object>
,react.ValueView.Listener<Object>
Handles multiple GestureDirectors listening on a single layer. A GestureDirector is only given a
touch start event if it originated within that director's region bounds. It is only given one of
the other events if that event is for a touch that started within that director's region bounds.
-
Constructor Summary
ConstructorDescriptionGestureRegionDirector
(Platform plat, Timer timer) Creates an uninitalized GestureRegionDirector.GestureRegionDirector
(Platform plat, Timer timer, Layer layer, pythagoras.f.IRectangle bounds) Creates a GestureRegionDirector with default options. -
Method Summary
Modifier and TypeMethodDescriptiongetPercentRegion
(float perX, float perY, float perWidth, float perHeight) Gets a region bounded by the given dimensions as defined as percentages of this GestureRegionDirector's defined bounds.getPercentRegion
(pythagoras.f.IRectangle bounds) Gets a Region instance bounded by the given dimensions as defined as percentages of this GestureRegionDirector's defined bounds.getRegion
(float x, float y, float width, float height) Gets a Region instance bounded by the given dimensions.getRegion
(pythagoras.f.IRectangle bounds) Gets a Region instance bounded by the given dimensions.void
onCancel
(Touch.Interaction iact) void
onEnd
(Touch.Interaction iact) void
onMove
(Touch.Interaction iact) void
onStart
(Touch.Interaction iact) void
remove()
Methods inherited from class playn.scene.Touch.Listener
onEmit
Methods inherited from class react.Slot
andThen, compose, filtered, onChange
-
Constructor Details
-
GestureRegionDirector
Creates an uninitalized GestureRegionDirector. setLayer() must be called separately. -
GestureRegionDirector
public GestureRegionDirector(Platform plat, Timer timer, Layer layer, pythagoras.f.IRectangle bounds) Creates a GestureRegionDirector with default options.- Parameters:
bounds
- The bounds in which to react to touch events.
-
-
Method Details
-
setLayer
-
remove
public void remove() -
getRegions
-
getRegion
Gets a Region instance bounded by the given dimensions. The given bounds will restricted to the given bounds of this GestureRegionDirector, and null may be returned if suitable bounds are not found or a conflicting region was already defined on this GestureRegionDirector. -
getRegion
Gets a Region instance bounded by the given dimensions. The given bounds will be restricted to the given bounds of this GestureRegionDirector, and null may be returned if suitable bounds are not found or a conflicting region was already defined on this GestureRegionDirector. -
getPercentRegion
Gets a region bounded by the given dimensions as defined as percentages of this GestureRegionDirector's defined bounds. Null may be returned if suitable bounds are not found or a conflicting Region was already defined on this GestureRegionDirector. -
getPercentRegion
Gets a Region instance bounded by the given dimensions as defined as percentages of this GestureRegionDirector's defined bounds. Null may be returned if suitable bounds are not found or a conflicting Region was already defined on this GestureRegionDirector. -
onStart
- Overrides:
onStart
in classTouch.Listener
-
onMove
- Overrides:
onMove
in classTouch.Listener
-
onEnd
- Overrides:
onEnd
in classTouch.Listener
-
onCancel
- Overrides:
onCancel
in classTouch.Listener
-