Package nl.colorize.multimedialib.stage
Class Transform
java.lang.Object
nl.colorize.multimedialib.stage.Transform
- All Implemented Interfaces:
Transformable
Defines the list of transformation properties that should be applied
to graphics when displaying them. The table below shows all available
properties, along with the graphics types that support them:
| Property | Defined as | Supported by | |-------------------|--------------------------------------------|--------------------| | Visible | true/false | All graphics types | | Position | X/Y relative to the graphic's center | All graphics types | | 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 | Sprite, Primitive | | Mask color | Replaces non-transparent pixels with color | Sprite |
Transform
instances represent a local transforms, with
their properties interpreted relative to their parent. In contrast,
global transforms are interpreted relative to the stage. Changing
a property in a local transform will automatically propagate to the
attached global transform.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPosition
(float deltaX, float deltaY) void
addRotation
(float degrees) void
float
getAlpha()
float
float
float
getX()
float
getY()
boolean
boolean
boolean
void
void
setAlpha
(float alpha) void
setFlipHorizontal
(boolean flipHorizontal) void
setFlipVertical
(boolean flipVertical) void
setMaskColor
(ColorRGB maskColor) void
setPosition
(float x, float y) void
setPosition
(Point2D position) void
setRotation
(float degrees) void
setRotation
(Angle rotation) void
setScale
(float scale) void
setScaleX
(float scaleX) void
setScaleY
(float scaleY) void
setVisible
(boolean visible) void
setX
(float x) void
setY
(float y)
-
Constructor Details
-
Transform
public Transform()
-
-
Method Details
-
setVisible
public void setVisible(boolean visible) -
setPosition
-
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()- Specified by:
getX
in interfaceTransformable
-
getY
public float getY()- Specified by:
getY
in interfaceTransformable
-
setRotation
-
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()- Specified by:
getScaleX
in interfaceTransformable
-
setScaleY
public void setScaleY(float scaleY) -
getScaleY
public float getScaleY()- Specified by:
getScaleY
in interfaceTransformable
-
setFlipHorizontal
public void setFlipHorizontal(boolean flipHorizontal) -
setFlipVertical
public void setFlipVertical(boolean flipVertical) -
setAlpha
public void setAlpha(float alpha) -
setMaskColor
-
set
-
combine
-
isVisible
public boolean isVisible()- Specified by:
isVisible
in interfaceTransformable
-
getPosition
- Specified by:
getPosition
in interfaceTransformable
-
getRotation
- Specified by:
getRotation
in interfaceTransformable
-
isFlipHorizontal
public boolean isFlipHorizontal()- Specified by:
isFlipHorizontal
in interfaceTransformable
-
isFlipVertical
public boolean isFlipVertical()- Specified by:
isFlipVertical
in interfaceTransformable
-
getAlpha
public float getAlpha()- Specified by:
getAlpha
in interfaceTransformable
-
getMaskColor
- Specified by:
getMaskColor
in interfaceTransformable
-