Class ImageRenderer

java.lang.Object
de.gurkenlabs.litiengine.graphics.ImageRenderer

public final class ImageRenderer extends Object
This class provides static methods to render an Image to a given Graphics2D object at specified screen coordinates. It includes methods for rendering images with transformations such as rotation, scaling, and custom affine transformations. This class is final and cannot be instantiated.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    render(Graphics2D g, Image image, double x, double y)
    Renders the specified Image to the given Graphics2D object at the specified coordinates.
    static void
    render(Graphics2D g, Image image, Point2D renderLocation)
    Renders the specified Image to the given Graphics2D object at the specified location.
    static void
    renderRotated(Graphics2D g, Image image, double x, double y, double angle)
    Note that rotating an image with 90/180/270 degree is way more performant.
    static void
    renderRotated(Graphics2D g, Image image, Point2D renderLocation, double angle)
    Renders the specified Image to the given Graphics2D object at the specified location with rotation.
    static void
    renderScaled(Graphics2D g, Image image, double x, double y, double scale)
    Renders the specified Image to the given Graphics2D object at the specified coordinates with scaling.
    static void
    renderScaled(Graphics2D g, Image image, double x, double y, double scaleX, double scaleY)
    Renders the specified Image to the given Graphics2D object at the specified coordinates with scaling.
    static void
    renderScaled(Graphics2D g, Image image, Point2D location, double scale)
    Renders the specified Image to the given Graphics2D object at the specified location with scaling.
    static void
    renderScaled(Graphics2D g, Image image, Point2D location, double scaleX, double scaleY)
    Renders the specified Image to the given Graphics2D object at the specified location with scaling.
    static void
    renderTransformed(Graphics2D g, Image image, double x, double y, AffineTransform transform)
    Renders the specified Image to the given Graphics2D object at the specified coordinates with a custom affine transformation.
    static void
    Renders the specified Image to the given Graphics2D object with a custom affine transformation.
    static void
    renderTransformed(Graphics2D g, Image image, Point2D renderLocation, AffineTransform transform)
    Renders the specified Image to the given Graphics2D object at the specified location with a custom affine transformation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • render

      public static void render(Graphics2D g, Image image, double x, double y)
      Renders the specified Image to the given Graphics2D object at the specified coordinates.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      x - The x-coordinate of the image.
      y - The y-coordinate of the image.
    • render

      public static void render(Graphics2D g, Image image, Point2D renderLocation)
      Renders the specified Image to the given Graphics2D object at the specified location.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      renderLocation - The location where the image will be drawn.
    • renderRotated

      public static void renderRotated(Graphics2D g, Image image, double x, double y, double angle)
      Note that rotating an image with 90/180/270 degree is way more performant. than rotating with in other degrees.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn
      x - The x-coordinate of the image.
      y - The y-coordinate of the image
      angle - The angle by which the image will be rotated.
    • renderRotated

      public static void renderRotated(Graphics2D g, Image image, Point2D renderLocation, double angle)
      Renders the specified Image to the given Graphics2D object at the specified location with rotation.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      renderLocation - The location where the image will be drawn.
      angle - The angle by which the image will be rotated.
    • renderScaled

      public static void renderScaled(Graphics2D g, Image image, double x, double y, double scale)
      Renders the specified Image to the given Graphics2D object at the specified coordinates with scaling.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      x - The x-coordinate of the image.
      y - The y-coordinate of the image.
      scale - The scale factor for both width and height.
    • renderScaled

      public static void renderScaled(Graphics2D g, Image image, Point2D location, double scale)
      Renders the specified Image to the given Graphics2D object at the specified location with scaling.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      location - The location where the image will be drawn.
      scale - The scale factor for both width and height.
    • renderScaled

      public static void renderScaled(Graphics2D g, Image image, Point2D location, double scaleX, double scaleY)
      Renders the specified Image to the given Graphics2D object at the specified location with scaling.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      location - The location where the image will be drawn.
      scaleX - The scale factor for the width.
      scaleY - The scale factor for the height.
    • renderScaled

      public static void renderScaled(Graphics2D g, Image image, double x, double y, double scaleX, double scaleY)
      Renders the specified Image to the given Graphics2D object at the specified coordinates with scaling.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      x - The x-coordinate of the image.
      y - The y-coordinate of the image.
      scaleX - The scale factor for the width.
      scaleY - The scale factor for the height.
    • renderTransformed

      public static void renderTransformed(Graphics2D g, Image image, Point2D renderLocation, AffineTransform transform)
      Renders the specified Image to the given Graphics2D object at the specified location with a custom affine transformation.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      renderLocation - The location where the image will be drawn.
      transform - The affine transformation to be applied to the image.
    • renderTransformed

      public static void renderTransformed(Graphics2D g, Image image, double x, double y, AffineTransform transform)
      Renders the specified Image to the given Graphics2D object at the specified coordinates with a custom affine transformation.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      x - The x-coordinate of the image.
      y - The y-coordinate of the image.
      transform - The affine transformation to be applied to the image.
    • renderTransformed

      public static void renderTransformed(Graphics2D g, Image image, AffineTransform transform)
      Renders the specified Image to the given Graphics2D object with a custom affine transformation.
      Parameters:
      g - The graphics object to draw on.
      image - The image to be drawn.
      transform - The affine transformation to be applied to the image.