Class ImageRenderer
java.lang.Object
de.gurkenlabs.litiengine.graphics.ImageRenderer
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 TypeMethodDescriptionstatic voidrender(Graphics2D g, Image image, double x, double y) Renders the specifiedImageto the givenGraphics2Dobject at the specified coordinates.static voidrender(Graphics2D g, Image image, Point2D renderLocation) Renders the specifiedImageto the givenGraphics2Dobject at the specified location.static voidrenderRotated(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 voidrenderRotated(Graphics2D g, Image image, Point2D renderLocation, double angle) Renders the specifiedImageto the givenGraphics2Dobject at the specified location with rotation.static voidrenderScaled(Graphics2D g, Image image, double x, double y, double scale) Renders the specifiedImageto the givenGraphics2Dobject at the specified coordinates with scaling.static voidrenderScaled(Graphics2D g, Image image, double x, double y, double scaleX, double scaleY) Renders the specifiedImageto the givenGraphics2Dobject at the specified coordinates with scaling.static voidrenderScaled(Graphics2D g, Image image, Point2D location, double scale) Renders the specifiedImageto the givenGraphics2Dobject at the specified location with scaling.static voidrenderScaled(Graphics2D g, Image image, Point2D location, double scaleX, double scaleY) Renders the specifiedImageto the givenGraphics2Dobject at the specified location with scaling.static voidrenderTransformed(Graphics2D g, Image image, double x, double y, AffineTransform transform) Renders the specifiedImageto the givenGraphics2Dobject at the specified coordinates with a custom affine transformation.static voidrenderTransformed(Graphics2D g, Image image, AffineTransform transform) Renders the specifiedImageto the givenGraphics2Dobject with a custom affine transformation.static voidrenderTransformed(Graphics2D g, Image image, Point2D renderLocation, AffineTransform transform) Renders the specifiedImageto the givenGraphics2Dobject at the specified location with a custom affine transformation.
-
Method Details
-
render
Renders the specifiedImageto the givenGraphics2Dobject 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
Renders the specifiedImageto the givenGraphics2Dobject 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
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 drawnx- The x-coordinate of the image.y- The y-coordinate of the imageangle- The angle by which the image will be rotated.
-
renderRotated
Renders the specifiedImageto the givenGraphics2Dobject 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
Renders the specifiedImageto the givenGraphics2Dobject 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
Renders the specifiedImageto the givenGraphics2Dobject 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 specifiedImageto the givenGraphics2Dobject 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 specifiedImageto the givenGraphics2Dobject 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 specifiedImageto the givenGraphics2Dobject 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 specifiedImageto the givenGraphics2Dobject 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
Renders the specifiedImageto the givenGraphics2Dobject 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.
-