APIdia Launch Partner
Top Description Methods
com.badlogic.gdx.maps

public Interface MapRenderer

Known Direct Subinterfaces
com.badlogic.gdx.maps.tiled.TiledMapRenderer
Imports
com.badlogic.gdx.graphics.OrthographicCamera, com.badlogic.gdx.math.Matrix4

Models a common way of rendering Map objects

Method Summary

Modifier and TypeMethod and Description
public void
render()

Renders all the layers of a map.

public void
render(int[]
the layers to render.
layers
)

Renders the given layers of a map.

public void
setView(OrthographicCamera camera)

Sets the projection matrix and viewbounds from the given camera.

public void
setView(Matrix4 projectionMatrix, float viewboundsX, float viewboundsY, float viewboundsWidth, float viewboundsHeight)

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

Method Detail

renderback to summary
public void render()

Renders all the layers of a map.

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

Renders the given layers of a map.

Parameters
layers:int[]

the layers to render.

setViewback to summary
public void setView(OrthographicCamera camera)

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.

Parameters
camera:OrthographicCamera

the OrthographicCamera

setViewback to summary
public void setView(Matrix4 projectionMatrix, float viewboundsX, float viewboundsY, float viewboundsWidth, float viewboundsHeight)

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.