Class Transform

java.lang.Object
nl.colorize.multimedialib.stage.Transform

public final class Transform extends Object
Defines the list of transformation properties that should be applied to graphics when displaying them.

The following transform properties are available:

 | Property          | Defined as                                 | Supported by       |
 |-------------------|--------------------------------------------|--------------------|
 | Visible           | true/false                                 | All graphics       |
 | Position          | X/Y relative to the graphic's center       | All graphics       |
 | Rotation          | Degrees, clockwise                         | Sprite             |
 | Scale             | Percentage, 100% indicates original size   | Sprite             |
 | Flip horizontally | true/false                                 | Sprite             |
 | Flip vertically   | true/false                                 | Sprite             |
 | Alpha             | Percentage, 100% indicates opaque          | All graphics       |
 | Mask color        | Replaces non-transparent pixels with color | Sprite, Primitive  |
 

The properties in a Transform instance are relative to its location in the scene graph. In other words, it describes a graphic's local transform. The renderer then combines this with the transform of the graphic's parents to calculate the global transform relative to the stage.

  • Constructor Details

    • Transform

      public Transform()
  • Method Details

    • setPosition

      public void setPosition(Point2D position)
    • setPosition

      public void setPosition(float x, float y)
    • setX

      public void setX(float x)
    • setY

      public void setY(float y)
    • addPosition

      public void addPosition(float deltaX, float deltaY)
    • getX

      public float getX()
    • getY

      public float getY()
    • setRotation

      public void setRotation(Angle rotation)
    • setRotation

      public void setRotation(float degrees)
    • addRotation

      public void addRotation(float degrees)
    • setScale

      public void setScale(float scale)
    • setScaleX

      public void setScaleX(float scaleX)
    • getScaleX

      public float getScaleX()
    • setScaleY

      public void setScaleY(float scaleY)
    • getScaleY

      public float getScaleY()
    • setAlpha

      public void setAlpha(float alpha)
    • set

      public void set(Transform other)
      Replaces all transformation properties in this Transform with the values from the specified other Transform.
    • combine

      public Transform combine(Transform other)
      Returns a new Transform instance that is the result of combining this transform with the specified other transform.
    • isVisible

      public boolean isVisible()
    • getPosition

      public Point2D getPosition()
    • getRotation

      public Angle getRotation()
    • isFlipHorizontal

      public boolean isFlipHorizontal()
    • isFlipVertical

      public boolean isFlipVertical()
    • getAlpha

      public float getAlpha()
    • getMaskColor

      public ColorRGB getMaskColor()
    • setVisible

      public void setVisible(boolean visible)
    • setFlipHorizontal

      public void setFlipHorizontal(boolean flipHorizontal)
    • setFlipVertical

      public void setFlipVertical(boolean flipVertical)
    • setMaskColor

      public void setMaskColor(ColorRGB maskColor)