Package com.mygdx.game.Components
Class TileMap
java.lang.Object
com.mygdx.game.Components.Component
com.mygdx.game.Components.TileMap
public class TileMap extends Component
Component that allows the rendering of tilemaps (has its own sprite batch)
-
Field Summary
Fields inherited from class com.mygdx.game.Components.Component
parent, reqsMet, requirements, type -
Constructor Summary
Constructors Constructor Description TileMap(int id, RenderLayer layer) -
Method Summary
Modifier and Type Method Description voidcleanUp()Called once after the update loop has finished.com.badlogic.gdx.maps.tiled.TiledMapTileLayer.CellgetCell(com.badlogic.gdx.math.Vector2 pos)Gets cell at position (in world space, must be n the maps range)com.badlogic.gdx.math.Vector2getTileDim()com.badlogic.gdx.maps.tiled.TiledMapgetTileMap()voidrender()draws the first 2 layersvoidupdate()Updates the renderer's view with the rendering cameraMethods inherited from class com.mygdx.game.Components.Component
awake, getParent, getType, setParent, setRequirements, startMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TileMap
- Parameters:
id- resource id of the tilemaplayer- rendering layer
-
-
Method Details
-
getCell
public com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell getCell(com.badlogic.gdx.math.Vector2 pos)Gets cell at position (in world space, must be n the maps range)- Parameters:
pos- pos in world space- Returns:
- the cell found
-
getTileDim
public com.badlogic.gdx.math.Vector2 getTileDim() -
getTileMap
public com.badlogic.gdx.maps.tiled.TiledMap getTileMap() -
update
public void update()Updates the renderer's view with the rendering camera -
render
public void render()draws the first 2 layers -
cleanUp
public void cleanUp()Description copied from class:ComponentCalled once after the update loop has finished.
-