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

public class RotationImageEffect extends ImageEffect
  • Constructor Details

    • RotationImageEffect

      public RotationImageEffect(int ttl, float angle)
      Initializes a new instance of the RotationImageEffect.
      Parameters:
      ttl - The time to live of this effect.
      angle - The angle by which this effect rotates the base image.
  • Method Details

    • apply

      public BufferedImage apply(BufferedImage image)
      Applies a rotation transformation to the provided BufferedImage. 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 compatible BufferedImage with those dimensions.
      Specified by:
      apply in class ImageEffect
      Parameters:
      image - the BufferedImage to be rotated. If null, the method returns null.
      Returns:
      a new BufferedImage representing the rotated image, or null if the input image was null.
    • getAngle

      public double getAngle()