Package playn.scene
Class Interaction<E extends Event.XY>
java.lang.Object
playn.scene.Interaction<E>
- All Implemented Interfaces:
XY
- Direct Known Subclasses:
Mouse.Interaction
,Pointer.Interaction
,Touch.Interaction
Contains information about the interaction of which an event is a part.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels this interaction.void
capture()
Captures this interaction inONLY
mode.void
Captures this interaction in the specified capture mode.boolean
captured()
Returns whether this interaction is captured.toString()
float
x()
Returnsevent
's x coordinate, for convenience.float
y()
Returnsevent
's y coordinate, for convenience.
-
Field Details
-
hitLayer
The layer that was hit at the start of this interaction. -
local
The current event's location, translated into the hit layer's coordinate space. -
event
The event currently being dispatched in this interaction.
-
-
Constructor Details
-
Interaction
-
-
Method Details
-
x
public float x()Returnsevent
's x coordinate, for convenience. -
y
public float y()Returnsevent
's y coordinate, for convenience. -
captured
public boolean captured()Returns whether this interaction is captured. -
capture
public void capture()Captures this interaction inONLY
mode. This causes subsequent events in this interaction to go only to the layer which is currently handling the interaction. Other layers in the interaction will receive a cancellation event and nothing further. -
capture
Captures this interaction in the specified capture mode. Depending on the mode, subsequent events will go only to the current layer, or that layer and its parents, or that layer and its children. Other layers in the interaction will receive a cancellation event and nothing further. -
cancel
public void cancel()Cancels this interaction. All layers which normally participate in the action will be notified of the cancellation. -
toString
-