APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.maps.tiled.renderers

public abstract Class BatchTiledMapRenderer

extends Object
implements TiledMapRenderer, Disposable
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.utils.Disposable, com.badlogic.gdx.maps.tiled.TiledMapRenderer, com.badlogic.gdx.maps.MapRenderer
Known Direct Subclasses
com.badlogic.gdx.maps.tiled.renderers.HexagonalTiledMapRenderer, com.badlogic.gdx.maps.tiled.renderers.IsometricStaggeredTiledMapRenderer, com.badlogic.gdx.maps.tiled.renderers.IsometricTiledMapRenderer, com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer
Static Imports
com.badlogic.gdx.graphics.g2d.Batch.C1, .Batch.C2, .Batch.C3, .Batch.C4, .Batch.U1, .Batch.U2, .Batch.U3, .Batch.U4, .Batch.V1, .Batch.V2, .Batch.V3, .Batch.V4, .Batch.X1, .Batch.X2, .Batch.X3, .Batch.X4, .Batch.Y1, .Batch.Y2, .Batch.Y3, .Batch.Y4

Field Summary

Modifier and TypeField and Description
protected Batch
protected Rectangle
protected TiledMap
protected static final int
protected boolean
protected Rectangle
protected float
protected float[]
protected Rectangle

Constructor Summary

AccessConstructor and Description
public
public
BatchTiledMapRenderer(TiledMap map, float unitScale)

public
public
BatchTiledMapRenderer(TiledMap map, float unitScale, Batch batch)

Method Summary

Modifier and TypeMethod and Description
protected void
beginRender()

Called before the rendering of all layers starts.

public void
dispose()

Implements com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

protected void
endRender()

Called after the rendering of all layers ended.

public Batch
protected float

Returns:

The float color value to use for rendering.
getImageLayerColor
(TiledMapImageLayer
The layer to render.
layer
,
Color
The current color of the batch.
batchColor
)

Calculates the float color for rendering an image layer, taking into account the layer's tint color, opacity, and whether the image format supports transparency then multiplying is against the batchColor

public TiledMap
protected float
getTileLayerColor(TiledMapTileLayer layer, Color batchColor)

Calculates the float color for rendering a tile layer, taking into account the layer's tint color and opacity, then multiplying is against the batchColor

public float
public Rectangle
public void
render()

Implements com.badlogic.gdx.maps.MapRenderer.render.

Renders all the layers of a map.

public void
render(int[] layers)

Implements com.badlogic.gdx.maps.MapRenderer.render.

Renders the given layers of a map.

public void
public void
public void
public void
public void
public void
setView(OrthographicCamera camera)

Implements com.badlogic.gdx.maps.MapRenderer.setView.

Sets the projection matrix and viewbounds from the given camera.

public void
setView(Matrix4 projection, float x, float y, float width, float height)

Implements com.badlogic.gdx.maps.MapRenderer.setView.

Sets the projection matrix for rendering, as well as the bounds of the map which should be rendered.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

batchback to summary
protected Batch batch
imageBoundsback to summary
protected Rectangle imageBounds
mapback to summary
protected TiledMap map
NUM_VERTICESback to summary
protected static final int NUM_VERTICES
ownsBatchback to summary
protected boolean ownsBatch
repeatedImageBoundsback to summary
protected Rectangle repeatedImageBounds
unitScaleback to summary
protected float unitScale
verticesback to summary
protected float[] vertices
viewBoundsback to summary
protected Rectangle viewBounds

Constructor Detail

BatchTiledMapRendererback to summary
public BatchTiledMapRenderer(TiledMap map)
BatchTiledMapRendererback to summary
public BatchTiledMapRenderer(TiledMap map, float unitScale)
BatchTiledMapRendererback to summary
public BatchTiledMapRenderer(TiledMap map, Batch batch)
BatchTiledMapRendererback to summary
public BatchTiledMapRenderer(TiledMap map, float unitScale, Batch batch)

Method Detail

beginRenderback to summary
protected void beginRender()

Called before the rendering of all layers starts.

disposeback to summary
public void dispose()

Implements com.badlogic.gdx.utils.Disposable.dispose.

Doc from com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

Annotations
@Override
endRenderback to summary
protected void endRender()

Called after the rendering of all layers ended.

getBatchback to summary
public Batch getBatch()
getImageLayerColorback to summary
protected float getImageLayerColor(TiledMapImageLayer layer, Color batchColor)

Calculates the float color for rendering an image layer, taking into account the layer's tint color, opacity, and whether the image format supports transparency then multiplying is against the batchColor

Parameters
layer:TiledMapImageLayer

The layer to render.

batchColor:Color

The current color of the batch.

Returns:float

The float color value to use for rendering.

getMapback to summary
public TiledMap getMap()
getTileLayerColorback to summary
protected float getTileLayerColor(TiledMapTileLayer layer, Color batchColor)

Calculates the float color for rendering a tile layer, taking into account the layer's tint color and opacity, then multiplying is against the batchColor

getUnitScaleback to summary
public float getUnitScale()
getViewBoundsback to summary
public Rectangle getViewBounds()
renderback to summary
public void render()

Implements com.badlogic.gdx.maps.MapRenderer.render.

Doc from com.badlogic.gdx.maps.MapRenderer.render.

Renders all the layers of a map.

Annotations
@Override
renderback to summary
public void render(int[] layers)

Implements com.badlogic.gdx.maps.MapRenderer.render.

Doc from com.badlogic.gdx.maps.MapRenderer.render.

Renders the given layers of a map.

Annotations
@Override
renderImageLayerback to summary
public void renderImageLayer(TiledMapImageLayer layer)

Implements com.badlogic.gdx.maps.tiled.TiledMapRenderer.renderImageLayer.

Annotations
@Override
renderMapLayerback to summary
public void renderMapLayer(MapLayer layer)
renderObjectback to summary
public void renderObject(MapObject object)

Implements com.badlogic.gdx.maps.tiled.TiledMapRenderer.renderObject.

Annotations
@Override
renderObjectsback to summary
public void renderObjects(MapLayer layer)

Implements com.badlogic.gdx.maps.tiled.TiledMapRenderer.renderObjects.

Annotations
@Override
setMapback to summary
public void setMap(TiledMap map)
setViewback to summary
public void setView(OrthographicCamera camera)

Implements com.badlogic.gdx.maps.MapRenderer.setView.

Doc from com.badlogic.gdx.maps.MapRenderer.setView.

Sets the projection matrix and viewbounds from the given camera. If the camera changes, you have to call this method again. The viewbounds are taken from the camera's position and viewport size as well as the scale. This method will only work if the camera's direction vector is (0,0,-1) and its up vector is (0, 1, 0), which are the defaults.

Annotations
@Override
setViewback to summary
public void setView(Matrix4 projection, float x, float y, float width, float height)

Implements com.badlogic.gdx.maps.MapRenderer.setView.

Doc from com.badlogic.gdx.maps.MapRenderer.setView.

Sets the projection matrix for rendering, as well as the bounds of the map which should be rendered. Make sure that the frustum spanned by the projection matrix coincides with the viewbounds.

Annotations
@Override