| Modifier and Type | Class | Description |
|---|---|---|
class |
CanvasLayer |
Simplifies the process of displaying a
Canvas which is updated after its initial
creation. |
class |
ClippedLayer |
A layer whose rendering is (usually) clipped to a rectangle.
|
class |
GroupLayer |
GroupLayer creates a Layer hierarchy by maintaining an ordered group of child Layers.
|
class |
ImageLayer |
A layer that displays a texture or region of a texture (tile).
|
class |
RootLayer |
Serves as the root of the scene graph.
|
| Modifier and Type | Field | Description |
|---|---|---|
Layer |
Interaction.hitLayer |
The layer that was hit at the start of this interaction.
|
| Modifier and Type | Method | Description |
|---|---|---|
Layer |
Layer.absorbHits() |
Configures a hit tester for this layer which hits this layer any time a hit does not hit a
child of this layer.
|
Layer |
GroupLayer.childAt(int index) |
Returns the layer at the specified index.
|
static Layer |
LayerUtil.getHitLayer(Layer root,
pythagoras.f.Point p) |
Returns the layer hit by (screen) position
p (or null) in the scene graph rooted at
root, using hitTest(pythagoras.f.Point). |
Layer |
Layer.hitTest(pythagoras.f.Point p) |
Tests whether the supplied (layer relative) point "hits" this layer or any of its children.
|
Layer |
Layer.HitTester.hitTest(Layer layer,
pythagoras.f.Point p) |
Returns
layer, or a child of layer if the supplied coordinate (which is in
layer's coordinate system) hits layer, or one of its children. |
Layer |
GroupLayer.hitTestDefault(pythagoras.f.Point point) |
|
Layer |
Layer.hitTestDefault(pythagoras.f.Point p) |
Like
hitTest(pythagoras.f.Point) except that it ignores a configured Layer.HitTester. |
static Layer |
LayerUtil.layerUnderPoint(Layer root,
float x,
float y) |
Gets the layer underneath the given screen coordinates, ignoring hit testers.
|
Layer |
Layer.setAlpha(float alpha) |
Sets the alpha component of this layer's current tint.
|
Layer |
Layer.setBatch(playn.core.QuadBatch batch) |
Configures a custom batch (i.e.
|
Layer |
Layer.setDepth(float depth) |
Sets the depth of this layer.
|
Layer |
Layer.setHitTester(Layer.HitTester tester) |
Configures a custom hit tester for this layer.
|
Layer |
Layer.setInteractive(boolean interactive) |
Configures this layer as reactive to clicks and touches, or not.
|
Layer |
Layer.setOrigin(float x,
float y) |
Sets the origin of the layer to a fixed position.
|
Layer |
Layer.setOrigin(Layer.Origin origin) |
Configures the origin of this layer based on a logical location which is recomputed whenever
the layer changes size.
|
Layer |
Layer.setRotation(float angle) |
Sets the current rotation of this layer, in radians.
|
Layer |
Layer.setScale(float scale) |
Sets the current x and y scale of this layer to
scale.. |
Layer |
Layer.setScale(float sx,
float sy) |
Sets the current x and y scale of this layer.
|
Layer |
Layer.setScaleX(float sx) |
Sets the current x scale of this layer.
|
Layer |
Layer.setScaleY(float sy) |
Sets the current y scale of this layer.
|
Layer |
Layer.setTint(int tint) |
Sets the tint for this layer, as
ARGB. |
Layer |
Layer.setTranslation(float x,
float y) |
Sets the x and y translation of this layer.
|
Layer |
Layer.setTranslation(pythagoras.f.XY trans) |
A variant of
setTranslation(float,float) that takes an XY. |
Layer |
Layer.setTx(float x) |
Sets the x translation of this layer.
|
Layer |
Layer.setTy(float y) |
Sets the y translation of this layer.
|
Layer |
Layer.setVisible(boolean visible) |
Configures this layer's visibility: if true, it will be rendered as normal, if false it and
its children will not be rendered.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Iterator<Layer> |
GroupLayer.iterator() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
GroupLayer.add(Layer child) |
Adds a layer to the bottom of the group.
|
void |
GroupLayer.add(Layer child0,
Layer child1,
Layer... childN) |
Adds all supplied children to this layer, in order.
|
void |
GroupLayer.addAt(Layer child,
float tx,
float ty) |
Adds the supplied layer to this group layer, adjusting its translation (relative to this group
layer) to the supplied values.
|
void |
GroupLayer.addCenterAt(Layer child,
float tx,
float ty) |
Adds
child to this group layer, positioning it such that its center is at (tx,
tx). |
void |
GroupLayer.addFloorAt(Layer child,
float tx,
float ty) |
Adds
child to this group layer, adjusting its translation (relative to this group
layer) to floor(tx), floor(ty). |
static void |
LayerUtil.bind(Layer layer,
react.Signal<playn.core.Clock> paint,
react.Slot<playn.core.Clock> onPaint) |
Automatically connects
onPaint to paint when layer is added to a scene
graph, and disconnects it when layer is removed. |
static void |
LayerUtil.bind(Layer layer,
react.Signal<playn.core.Clock> update,
react.Slot<playn.core.Clock> onUpdate,
react.Signal<playn.core.Clock> paint,
react.Slot<playn.core.Clock> onPaint) |
Automatically connects
onUpdate to update, and onPaint to
paint when layer is added to a scene graph, and disconnects them when layer
is removed. |
static Layer |
LayerUtil.getHitLayer(Layer root,
pythagoras.f.Point p) |
Returns the layer hit by (screen) position
p (or null) in the scene graph rooted at
root, using hitTest(pythagoras.f.Point). |
static int |
LayerUtil.graphDepth(Layer layer) |
Returns the depth of the given layer in its local scene graph.
|
Layer |
Layer.HitTester.hitTest(Layer layer,
pythagoras.f.Point p) |
Returns
layer, or a child of layer if the supplied coordinate (which is in
layer's coordinate system) hits layer, or one of its children. |
static boolean |
LayerUtil.hitTest(Layer layer,
float x,
float y) |
Returns true if a coordinate on the screen touches a
Layer. |
static boolean |
LayerUtil.hitTest(Layer layer,
pythagoras.f.XY pos) |
Returns true if an
XY touches a Layer. |
static int |
LayerUtil.indexInParent(Layer layer) |
Returns the index of the given layer within its parent, or -1 if the parent is null.
|
static pythagoras.f.Point |
LayerUtil.layerToParent(Layer layer,
Layer parent,
float x,
float y) |
Converts the supplied point from coordinates relative to the specified
child layer to coordinates relative to the specified parent layer.
|
static pythagoras.f.Point |
LayerUtil.layerToParent(Layer layer,
Layer parent,
pythagoras.f.XY point,
pythagoras.f.Point into) |
Converts the supplied point from coordinates relative to the specified
child layer to coordinates relative to the specified parent layer.
|
static pythagoras.f.Point |
LayerUtil.layerToScreen(Layer layer,
float x,
float y) |
Converts the supplied point from coordinates relative to the specified
layer to screen coordinates.
|
static pythagoras.f.Point |
LayerUtil.layerToScreen(Layer layer,
pythagoras.f.XY point,
pythagoras.f.Point into) |
Converts the supplied point from coordinates relative to the specified layer to screen
coordinates.
|
static Layer |
LayerUtil.layerUnderPoint(Layer root,
float x,
float y) |
Gets the layer underneath the given screen coordinates, ignoring hit testers.
|
static pythagoras.f.Point |
LayerUtil.parentToLayer(Layer parent,
Layer layer,
pythagoras.f.XY point,
pythagoras.f.Point into) |
Converts the supplied point from coordinates relative to the specified parent to coordinates
relative to the specified child layer.
|
static pythagoras.f.Point |
LayerUtil.parentToLayer(Layer layer,
pythagoras.f.XY point,
pythagoras.f.Point into) |
Converts the supplied point from coordinates relative to its parent
to coordinates relative to the specified layer.
|
static void |
LayerUtil.print(playn.core.Log log,
Layer layer) |
Prints the layer heirarchy starting at
layer, using Log.debug(java.lang.String). |
void |
GroupLayer.remove(Layer child) |
Removes a layer from the group.
|
void |
GroupLayer.remove(Layer child0,
Layer child1,
Layer... childN) |
Removes all supplied children from this layer, in order.
|
static pythagoras.f.Point |
LayerUtil.screenToLayer(Layer layer,
float x,
float y) |
Converts the supplied point from screen coordinates to coordinates
relative to the specified layer.
|
static pythagoras.f.Point |
LayerUtil.screenToLayer(Layer layer,
pythagoras.f.XY point,
pythagoras.f.Point into) |
Converts the supplied point from screen coordinates to coordinates
relative to the specified layer.
|
void |
Layer.Visitor.visit(Layer layer,
int depth) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
Layer.onAdded(react.SignalView.Listener<? super Layer> action) |
Connects
action to state such that it is triggered when this layer is added
to a rooted scene graph. |
void |
Layer.onDisposed(react.SignalView.Listener<? super Layer> action) |
Connects
action to state such that it is triggered when this layer is
disposed. |
void |
Layer.onRemoved(react.SignalView.Listener<? super Layer> action) |
Connects
action to state such that it is triggered when this layer is
removed from a rooted scene graph. |
| Constructor | Description |
|---|---|
Dispatcher(Layer root,
boolean bubble) |
|
Dispatcher(Layer root,
boolean bubble) |
|
Dispatcher(Layer root,
boolean bubble) |
|
Interaction(Layer hitLayer,
boolean bubble) |
|
Pointer(playn.core.Platform plat,
Layer root,
boolean bubble) |
Creates a pointer event system which dispatches both global pointer events and per-layer
pointer events.
|
Copyright © 2018. All Rights Reserved.