public final class RenderEngine
extends java.lang.Object
Environment
and with respect to the Camera
location and zoom.
Internally, it uses the static renderer implementations to actually execute the rendering process. This class basically prepares the specified render subject and passed them to a renderer with the current correct context.
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_RENDERSCALE |
Constructor and Description |
---|
RenderEngine()
Instantiates a new RenderEngine instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canRender(IEntity entity) |
void |
entityRenderingCondition(java.util.function.Predicate<IEntity> predicate) |
float |
getBaseRenderScale()
Gets the base render scale of the game.
|
void |
onEntityRendered(java.util.function.Consumer<RenderEvent<IEntity>> entity) |
void |
onEntityRendering(java.util.function.Consumer<RenderEvent<IEntity>> entity) |
static void |
render(java.awt.Graphics2D g,
java.util.Collection<? extends IRenderable> renderables) |
static void |
render(java.awt.Graphics2D g,
java.util.Collection<? extends IRenderable> renderables,
java.awt.Shape clip) |
static void |
render(java.awt.Graphics2D g,
IRenderable renderable) |
void |
renderEntities(java.awt.Graphics2D g,
java.util.Collection<? extends IEntity> entities) |
void |
renderEntities(java.awt.Graphics2D g,
java.util.Collection<? extends IEntity> entities,
boolean sort) |
void |
renderEntities(java.awt.Graphics2D g,
java.util.Collection<? extends IEntity> entities,
boolean sort,
java.awt.Shape clip) |
void |
renderEntities(java.awt.Graphics2D g,
java.util.Collection<? extends IEntity> entities,
java.awt.Shape clip) |
void |
renderEntity(java.awt.Graphics2D g,
IEntity entity) |
static void |
renderImage(java.awt.Graphics2D g,
java.awt.Image image,
double x,
double y) |
static void |
renderImage(java.awt.Graphics2D g,
java.awt.Image image,
java.awt.geom.Point2D location) |
static void |
renderOutline(java.awt.Graphics2D g,
java.awt.Shape shape) |
static void |
renderOutline(java.awt.Graphics2D g,
java.awt.Shape shape,
java.awt.Stroke stroke) |
static void |
renderShape(java.awt.Graphics2D g,
java.awt.Shape shape) |
static void |
renderShape(java.awt.Graphics2D g,
java.awt.Shape shape,
boolean antialiasing) |
static void |
renderText(java.awt.Graphics2D g,
java.lang.String text,
double x,
double y) |
static void |
renderText(java.awt.Graphics2D g,
java.lang.String text,
double x,
double y,
boolean antialias)
Draws the given string to the specified map location.
|
static void |
renderText(java.awt.Graphics2D g,
java.lang.String text,
java.awt.geom.Point2D location) |
static void |
renderText(java.awt.Graphics2D g,
java.lang.String text,
java.awt.geom.Point2D location,
boolean antialias) |
void |
setBaseRenderScale(float scale)
Sets the global base scale that is used to calculate the actual render scale of the game.
|
public static final float DEFAULT_RENDERSCALE
public RenderEngine()
You should never call this manually! Instead use the Game.graphics()
instance.
Game.graphics()
public static void renderText(java.awt.Graphics2D g, java.lang.String text, double x, double y, boolean antialias)
g
- The graphics object to draw on.text
- The text to be drawnx
- The x-coordinate of the text.y
- The y-coordinate of the textantialias
- Configure whether or not to render the text with antialiasing.public static void renderText(java.awt.Graphics2D g, java.lang.String text, double x, double y)
public static void renderText(java.awt.Graphics2D g, java.lang.String text, java.awt.geom.Point2D location, boolean antialias)
public static void renderText(java.awt.Graphics2D g, java.lang.String text, java.awt.geom.Point2D location)
public static void renderShape(java.awt.Graphics2D g, java.awt.Shape shape)
public static void renderShape(java.awt.Graphics2D g, java.awt.Shape shape, boolean antialiasing)
public static void renderOutline(java.awt.Graphics2D g, java.awt.Shape shape)
public static void renderOutline(java.awt.Graphics2D g, java.awt.Shape shape, java.awt.Stroke stroke)
public static void renderImage(java.awt.Graphics2D g, java.awt.Image image, double x, double y)
public static void renderImage(java.awt.Graphics2D g, java.awt.Image image, java.awt.geom.Point2D location)
public boolean canRender(IEntity entity)
public void entityRenderingCondition(java.util.function.Predicate<IEntity> predicate)
public float getBaseRenderScale()
public void onEntityRendered(java.util.function.Consumer<RenderEvent<IEntity>> entity)
public void onEntityRendering(java.util.function.Consumer<RenderEvent<IEntity>> entity)
public static void render(java.awt.Graphics2D g, java.util.Collection<? extends IRenderable> renderables)
public static void render(java.awt.Graphics2D g, java.util.Collection<? extends IRenderable> renderables, java.awt.Shape clip)
public static void render(java.awt.Graphics2D g, IRenderable renderable)
public void renderEntities(java.awt.Graphics2D g, java.util.Collection<? extends IEntity> entities)
public void renderEntities(java.awt.Graphics2D g, java.util.Collection<? extends IEntity> entities, boolean sort)
public void renderEntities(java.awt.Graphics2D g, java.util.Collection<? extends IEntity> entities, boolean sort, java.awt.Shape clip)
public void renderEntities(java.awt.Graphics2D g, java.util.Collection<? extends IEntity> entities, java.awt.Shape clip)
public void renderEntity(java.awt.Graphics2D g, IEntity entity)
public void setBaseRenderScale(float scale)
scale
- The base render scale for the game.ICamera.getRenderScale()