Class MapRenderer
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.MapRenderer
public class MapRenderer
extends java.lang.Object
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MapRenderer.LayerRenderCondition
This listener interface provides a condition callback to contol whether a layer should be rendered.static interface
MapRenderer.LayerRenderedListener
This listener interface receives events when a layer was rendered.Method Summary
Modifier and Type Method Description static void
addLayerRenderCondition(MapRenderer.LayerRenderCondition condition)
Adds the specified layer render condition to control whether layers should be rendered.protected static boolean
isVisible(ILayer layer)
static void
onLayerRendered(MapRenderer.LayerRenderedListener listener)
Adds the specified layer rendered listener to receive events when a layer has been rendered.static void
removeLayerRenderCondition(MapRenderer.LayerRenderCondition condition)
Removes the specified layer render condition.static void
removeLayerRenderedListener(MapRenderer.LayerRenderedListener listener)
Removes the specified layer rendered listener..static void
render(java.awt.Graphics2D g, IMap map, java.awt.geom.Rectangle2D viewport, Environment env, RenderType... renderTypes)
static void
render(java.awt.Graphics2D g, IMap map, java.awt.geom.Rectangle2D viewport, RenderType... renderTypes)
protected static void
renderImageLayer(java.awt.Graphics2D g, IImageLayer layer, IMap map, java.awt.geom.Rectangle2D viewport, float opacity)
protected static boolean
shouldBeRendered(java.awt.Graphics2D g, IMap map, ILayer layer, RenderType[] renderTypes)
Method Details
onLayerRendered
Adds the specified layer rendered listener to receive events when a layer has been rendered.- Parameters:
listener
- The listener to add.
removeLayerRenderedListener
Removes the specified layer rendered listener..- Parameters:
listener
- The listener to remove.
addLayerRenderCondition
Adds the specified layer render condition to control whether layers should be rendered.- Parameters:
condition
- The condition to add.
removeLayerRenderCondition
Removes the specified layer render condition.- Parameters:
condition
- The condition to remove.
render
public static void render(java.awt.Graphics2D g, IMap map, java.awt.geom.Rectangle2D viewport, RenderType... renderTypes)render
public static void render(java.awt.Graphics2D g, IMap map, java.awt.geom.Rectangle2D viewport, Environment env, RenderType... renderTypes)shouldBeRendered
protected static boolean shouldBeRendered(java.awt.Graphics2D g, IMap map, ILayer layer, RenderType[] renderTypes)isVisible
renderImageLayer
protected static void renderImageLayer(java.awt.Graphics2D g, IImageLayer layer, IMap map, java.awt.geom.Rectangle2D viewport, float opacity)