Class Transform
- java.lang.Object
-
- nl.colorize.multimedialib.graphics.Transform
-
- All Implemented Interfaces:
AlphaTransform
public class Transform extends java.lang.Object implements AlphaTransform
Transformation that can be applied to a graphic when displaying it. The transform consists of the following aspects:- Rotation (in degrees)
- Scale (as a percentage, 100% being the original size)
- Alpha (as a percentage, 100% is opaque, 0% is fully transparent)
- Color mask
-
-
Constructor Summary
Constructors Constructor Description Transform()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRotation(int degrees)Transformcopy()booleanequals(java.lang.Object o)intgetAlpha()ColorRGBgetMask()intgetRotation()floatgetRotationInRadians()intgetScaleX()intgetScaleY()inthashCode()booleanisDefaultTransform()Returns true if all of this transform's properties are set to their original/default values.booleanisRotated()booleanisScaled()voidreset()voidsetAlpha(int alpha)voidsetMask(ColorRGB mask)voidsetRotation(int degrees)voidsetScale(int scale)voidsetScale(int scaleX, int scaleY)voidsetScaleX(int scaleX)voidsetScaleY(int scaleY)static TransformwithAlpha(int alpha)Convenience method that creates a new transform with the specified alpha value, but all other properties set to their default values.static TransformwithMask(ColorRGB mask)Convenience method that creates a new transform with the specified color mask, but all other properties set to their default values.static TransformwithRotation(int rotation)Convenience method that creates a new transform with the specified rotation, but all other properties set to their default values.static TransformwithScale(int scale)Convenience method that creates a new transform with the specified scale, but all other properties set to their default values.static TransformwithScale(int scaleX, int scaleY)Convenience method that creates a new transform with the specified scale, but all other properties set to their default values.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nl.colorize.multimedialib.graphics.AlphaTransform
toTransform
-
-
-
-
Method Detail
-
reset
public void reset()
-
isDefaultTransform
public boolean isDefaultTransform()
Returns true if all of this transform's properties are set to their original/default values.
-
setRotation
public void setRotation(int degrees)
-
addRotation
public void addRotation(int degrees)
-
getRotation
public int getRotation()
-
getRotationInRadians
public float getRotationInRadians()
-
isRotated
public boolean isRotated()
-
setScale
public void setScale(int scale)
-
setScale
public void setScale(int scaleX, int scaleY)
-
setScaleX
public void setScaleX(int scaleX)
-
getScaleX
public int getScaleX()
-
setScaleY
public void setScaleY(int scaleY)
-
getScaleY
public int getScaleY()
-
isScaled
public boolean isScaled()
-
setAlpha
public void setAlpha(int alpha)
-
getAlpha
public int getAlpha()
- Specified by:
getAlphain interfaceAlphaTransform
-
setMask
public void setMask(ColorRGB mask)
-
getMask
public ColorRGB getMask()
-
copy
public Transform copy()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
withRotation
public static Transform withRotation(int rotation)
Convenience method that creates a new transform with the specified rotation, but all other properties set to their default values.
-
withScale
public static Transform withScale(int scaleX, int scaleY)
Convenience method that creates a new transform with the specified scale, but all other properties set to their default values.
-
withScale
public static Transform withScale(int scale)
Convenience method that creates a new transform with the specified scale, but all other properties set to their default values.
-
withAlpha
public static Transform withAlpha(int alpha)
Convenience method that creates a new transform with the specified alpha value, but all other properties set to their default values.
-
-