public abstract class BatchTiledMapRenderer extends java.lang.Object implements TiledMapRenderer, Disposable
Modifier and Type | Field and Description |
---|---|
protected TiledMap |
map |
protected boolean |
ownsSpriteBatch |
protected SpriteBatch |
spriteBatch |
protected float |
unitScale |
protected Rectangle |
viewBounds |
Constructor and Description |
---|
BatchTiledMapRenderer(TiledMap map) |
BatchTiledMapRenderer(TiledMap map,
float unitScale) |
BatchTiledMapRenderer(TiledMap map,
float unitScale,
SpriteBatch spriteBatch) |
BatchTiledMapRenderer(TiledMap map,
SpriteBatch spriteBatch) |
Modifier and Type | Method and Description |
---|---|
protected void |
beginRender()
Called before the rendering of all layers starts.
|
void |
dispose()
Releases all resources of this object.
|
protected void |
endRender()
Called after the rendering of all layers ended.
|
TiledMap |
getMap() |
SpriteBatch |
getSpriteBatch() |
float |
getUnitScale() |
Rectangle |
getViewBounds() |
void |
render()
Renders all the layers of a map.
|
void |
render(int[] layers)
Renders the given layers of a map.
|
void |
setMap(TiledMap map) |
void |
setView(Matrix4 projection,
float x,
float y,
float width,
float height)
Sets the projection matrix for rendering, as well as the bounds of the map
which should be rendered.
|
void |
setView(OrthographicCamera camera)
Sets the projection matrix and viewbounds from the given camera.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
renderObject, renderTileLayer
protected TiledMap map
protected float unitScale
protected SpriteBatch spriteBatch
protected Rectangle viewBounds
protected boolean ownsSpriteBatch
public BatchTiledMapRenderer(TiledMap map)
public BatchTiledMapRenderer(TiledMap map, float unitScale)
public BatchTiledMapRenderer(TiledMap map, SpriteBatch spriteBatch)
public BatchTiledMapRenderer(TiledMap map, float unitScale, SpriteBatch spriteBatch)
public TiledMap getMap()
public void setMap(TiledMap map)
public float getUnitScale()
public SpriteBatch getSpriteBatch()
public Rectangle getViewBounds()
public void setView(OrthographicCamera camera)
MapRenderer
setView
in interface MapRenderer
camera
- the OrthographicCamera
public void setView(Matrix4 projection, float x, float y, float width, float height)
MapRenderer
setView
in interface MapRenderer
public void render()
MapRenderer
render
in interface MapRenderer
public void render(int[] layers)
MapRenderer
render
in interface MapRenderer
protected void beginRender()
protected void endRender()
public void dispose()
Disposable
dispose
in interface Disposable