Class RotationImageEffect
java.lang.Object
de.gurkenlabs.litiengine.graphics.ImageEffect
de.gurkenlabs.litiengine.graphics.RotationImageEffect
- All Implemented Interfaces:
ITimeToLive,Comparable<ImageEffect>
- Direct Known Subclasses:
EntityRotationImageEffect
-
Constructor Summary
ConstructorsConstructorDescriptionRotationImageEffect(int ttl, float angle) Initializes a new instance of theRotationImageEffect. -
Method Summary
Modifier and TypeMethodDescriptionapply(BufferedImage image) Applies a rotation transformation to the providedBufferedImage.doublegetAngle()Methods inherited from class de.gurkenlabs.litiengine.graphics.ImageEffect
compareTo, getAliveTime, getName, getPriority, getTimeToLive, setName, setPriority, timeToLiveReached
-
Constructor Details
-
RotationImageEffect
public RotationImageEffect(int ttl, float angle) Initializes a new instance of theRotationImageEffect.- Parameters:
ttl- The time to live of this effect.angle- The angle by which this effect rotates the base image.
-
-
Method Details
-
apply
Applies a rotation transformation to the providedBufferedImage. This method rotates the given image by a specified angle, calculates the new dimensions needed to accommodate the rotated image without cropping, and creates a new compatibleBufferedImagewith those dimensions.- Specified by:
applyin classImageEffect- Parameters:
image- theBufferedImageto be rotated. Ifnull, the method returnsnull.- Returns:
- a new
BufferedImagerepresenting the rotated image, ornullif the input image wasnull.
-
getAngle
public double getAngle()
-