public class OrthogonalTiledMapRendererWithPeople
extends com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer
This class is an extension of the OrthogonalTiledMapRenderer that deals with rendering sprites aswell. The last layer of the map is designed to be drawn OVER the player sprite and NPCs. So this controls that by drawing each layer until it comes to the last one, then it draws the sprites, then the final layer.
Modifier and Type | Field and Description |
---|---|
java.util.List<AbstractPerson> |
people
This is the list of people that are to be rendered to the map
|
Constructor and Description |
---|
OrthogonalTiledMapRendererWithPeople(com.badlogic.gdx.maps.tiled.TiledMap map)
Constructor for the map renderer
|
Modifier and Type | Method and Description |
---|---|
void |
addPerson(AbstractPerson sprite)
This adds sprite to the list of sprites to be rendered before the final layer.
|
void |
addPerson(java.util.List<AbstractPerson> sprites)
This adds a list of AbstractPerson to the sprite list
|
void |
clearPeople()
This method clears the list of people to be rendered
|
void |
render()
This overrides the render method in the super class.
|
renderTileLayer
public java.util.List<AbstractPerson> people
public OrthogonalTiledMapRendererWithPeople(com.badlogic.gdx.maps.tiled.TiledMap map)
map
- - The TiledMap that is to be rendered using this rendererpublic void addPerson(AbstractPerson sprite)
sprite
- - Sprite to be addedpublic void addPerson(java.util.List<AbstractPerson> sprites)
sprites
- public void clearPeople()
public void render()
It draws all the map layers until the final one. Then it draws all the sprites in the sprite list, then it draws the final layer.
render
in interface com.badlogic.gdx.maps.MapRenderer
render
in class com.badlogic.gdx.maps.tiled.renderers.BatchTiledMapRenderer