Uses of Class
playn.scene.Layer
-
Uses of Layer in playn.scene
Subclasses of Layer in playn.scene Modifier and Type Class Description classCanvasLayerSimplifies the process of displaying aCanvaswhich is updated after its initial creation.classClippedLayerA layer whose rendering is (usually) clipped to a rectangle.classGroupLayerGroupLayer creates a Layer hierarchy by maintaining an ordered group of child Layers.classImageLayerA layer that displays a texture or region of a texture (tile).classRootLayerServes as the root of the scene graph.Fields in playn.scene declared as Layer Modifier and Type Field Description LayerInteraction. hitLayerThe layer that was hit at the start of this interaction.Methods in playn.scene that return Layer Modifier and Type Method Description LayerLayer. absorbHits()Configures a hit tester for this layer which hits this layer any time a hit does not hit a child of this layer.LayerGroupLayer. childAt(int index)Returns the layer at the specified index.static LayerLayerUtil. getHitLayer(Layer root, Point p)Returns the layer hit by (screen) positionp(or null) in the scene graph rooted atroot, usinghitTest(pythagoras.f.Point).LayerLayer. hitTest(Point p)Tests whether the supplied (layer relative) point "hits" this layer or any of its children.LayerLayer.HitTester. hitTest(Layer layer, Point p)Returnslayer, or a child oflayerif the supplied coordinate (which is inlayer's coordinate system) hitslayer, or one of its children.LayerGroupLayer. hitTestDefault(Point point)LayerLayer. hitTestDefault(Point p)LikehitTest(pythagoras.f.Point)except that it ignores a configuredLayer.HitTester.static LayerLayerUtil. layerUnderPoint(Layer root, float x, float y)Gets the layer underneath the given screen coordinates, ignoring hit testers.LayerLayer. setAlpha(float alpha)Sets the alpha component of this layer's current tint.LayerLayer. setBatch(QuadBatch batch)Configures a custom batch (i.e.LayerLayer. setDepth(float depth)Sets the depth of this layer.LayerLayer. setHitTester(Layer.HitTester tester)Configures a custom hit tester for this layer.LayerLayer. setInteractive(boolean interactive)Configures this layer as reactive to clicks and touches, or not.LayerLayer. setName(String name)Sets the name of this layer.LayerLayer. setOrigin(float x, float y)Sets the origin of the layer to a fixed position.LayerLayer. setOrigin(Layer.Origin origin)Configures the origin of this layer based on a logical location which is recomputed whenever the layer changes size.LayerLayer. setRotation(float angle)Sets the current rotation of this layer, in radians.LayerLayer. setScale(float scale)Sets the current x and y scale of this layer toscale..LayerLayer. setScale(float sx, float sy)Sets the current x and y scale of this layer.LayerLayer. setScaleX(float sx)Sets the current x scale of this layer.LayerLayer. setScaleY(float sy)Sets the current y scale of this layer.LayerLayer. setTint(int tint)Sets the tint for this layer, asARGB.LayerLayer. setTranslation(float x, float y)Sets the x and y translation of this layer.LayerLayer. setTranslation(XY trans)A variant ofsetTranslation(float,float)that takes anXY.LayerLayer. setTx(float x)Sets the x translation of this layer.LayerLayer. setTy(float y)Sets the y translation of this layer.LayerLayer. 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.Methods in playn.scene that return types with arguments of type Layer Modifier and Type Method Description Iterator<Layer>GroupLayer. iterator()Methods in playn.scene with parameters of type Layer Modifier and Type Method Description voidGroupLayer. add(Layer child)Adds a layer to the bottom of the group.voidGroupLayer. add(Layer child0, Layer child1, Layer... childN)Adds all supplied children to this layer, in order.voidGroupLayer. 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.voidGroupLayer. addCenterAt(Layer child, float tx, float ty)Addschildto this group layer, positioning it such that its center is at (tx,tx).voidGroupLayer. addFloorAt(Layer child, float tx, float ty)Addschildto this group layer, adjusting its translation (relative to this group layer) tofloor(tx), floor(ty).static voidLayerUtil. bind(Layer layer, Signal<Clock> paint, Slot<Clock> onPaint)Automatically connectsonPainttopaintwhenlayeris added to a scene graph, and disconnects it whenlayeris removed.static voidLayerUtil. bind(Layer layer, Signal<Clock> update, Slot<Clock> onUpdate, Signal<Clock> paint, Slot<Clock> onPaint)Automatically connectsonUpdatetoupdate, andonPainttopaintwhenlayeris added to a scene graph, and disconnects them whenlayeris removed.static LayerLayerUtil. getHitLayer(Layer root, Point p)Returns the layer hit by (screen) positionp(or null) in the scene graph rooted atroot, usinghitTest(pythagoras.f.Point).static intLayerUtil. graphDepth(Layer layer)Returns the depth of the given layer in its local scene graph.LayerLayer.HitTester. hitTest(Layer layer, Point p)Returnslayer, or a child oflayerif the supplied coordinate (which is inlayer's coordinate system) hitslayer, or one of its children.static booleanLayerUtil. hitTest(Layer layer, float x, float y)Returns true if a coordinate on the screen touches aLayer.static booleanLayerUtil. hitTest(Layer layer, XY pos)static intLayerUtil. indexInParent(Layer layer)Returns the index of the given layer within its parent, or -1 if the parent is null.static PointLayerUtil. 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 PointLayerUtil. layerToParent(Layer layer, Layer parent, XY point, Point into)Converts the supplied point from coordinates relative to the specified child layer to coordinates relative to the specified parent layer.static PointLayerUtil. layerToScreen(Layer layer, float x, float y)Converts the supplied point from coordinates relative to the specified layer to screen coordinates.static PointLayerUtil. layerToScreen(Layer layer, XY point, Point into)Converts the supplied point from coordinates relative to the specified layer to screen coordinates.static LayerLayerUtil. layerUnderPoint(Layer root, float x, float y)Gets the layer underneath the given screen coordinates, ignoring hit testers.static PointLayerUtil. parentToLayer(Layer parent, Layer layer, XY point, Point into)Converts the supplied point from coordinates relative to the specified parent to coordinates relative to the specified child layer.static PointLayerUtil. parentToLayer(Layer layer, XY point, Point into)Converts the supplied point from coordinates relative to its parent to coordinates relative to the specified layer.static voidLayerUtil. print(Log log, Layer layer)Prints the layer heirarchy starting atlayer, usingLog.debug(java.lang.String).voidGroupLayer. remove(Layer child)Removes a layer from the group.voidGroupLayer. remove(Layer child0, Layer child1, Layer... childN)Removes all supplied children from this layer, in order.static PointLayerUtil. screenToLayer(Layer layer, float x, float y)Converts the supplied point from screen coordinates to coordinates relative to the specified layer.static PointLayerUtil. screenToLayer(Layer layer, XY point, Point into)Converts the supplied point from screen coordinates to coordinates relative to the specified layer.voidLayer.Visitor. visit(Layer layer, int depth)Method parameters in playn.scene with type arguments of type Layer Modifier and Type Method Description voidLayer. onAdded(SignalView.Listener<? super Layer> action)Connectsactiontostatesuch that it is triggered when this layer is added to a rooted scene graph.voidLayer. onDisposed(SignalView.Listener<? super Layer> action)Connectsactiontostatesuch that it is triggered when this layer is disposed.voidLayer. onRemoved(SignalView.Listener<? super Layer> action)Connectsactiontostatesuch that it is triggered when this layer is removed from a rooted scene graph.Constructors in playn.scene with parameters of type Layer Constructor Description Dispatcher(Layer root, boolean bubble)Dispatcher(Layer root, boolean bubble)Dispatcher(Layer root, boolean bubble)Interaction(Layer hitLayer, boolean bubble)Pointer(Platform plat, Layer root, boolean bubble)Creates a pointer event system which dispatches both global pointer events and per-layer pointer events.