Package playn.scene

Class ClippedLayer

java.lang.Object
playn.scene.Layer
playn.scene.ClippedLayer
All Implemented Interfaces:
AutoCloseable, Closeable
Direct Known Subclasses:
GroupLayer

public abstract class ClippedLayer extends Layer
A layer whose rendering is (usually) clipped to a rectangle. The clipping rectangle is defined to be the layer's x, y coordinate (as adjusted by its origin) extended to the layer's scaled width and height.

NOTE: clipping rectangles cannot be rotated. If the layer has a rotation, the clipping region will be undefined (and most certainly wacky).

  • Constructor Details

    • ClippedLayer

      public ClippedLayer(float width, float height)
  • Method Details

    • width

      public float width()
      Description copied from class: Layer
      Returns the width of this layer. Note: not all layers know their size. Those that don't return 0.
      Overrides:
      width in class Layer
    • height

      public float height()
      Description copied from class: Layer
      Returns the height of this layer. Note: not all layers know their size. Those that don't return 0.
      Overrides:
      height in class Layer
    • setSize

      public ClippedLayer setSize(float width, float height)
      Updates the size of this clipped layer, and hence its clipping rectangle.
    • setSize

      public ClippedLayer setSize(IDimension size)
      Updates the size of this clipped layer, and hence its clipping rectangle.
    • setWidth

      public ClippedLayer setWidth(float width)
      Updates the width of this group layer, and hence its clipping rectangle.
    • setHeight

      public ClippedLayer setHeight(float height)
      Updates the height of this group layer, and hence its clipping rectangle.