Class TileMap


  • public class TileMap
    extends Component
    Component that allows the rendering of tilemaps (has its own sprite batch)
    • Constructor Summary

      Constructors 
      Constructor Description
      TileMap​(int id, RenderLayer layer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanUp()
      Called once after the update loop has finished.
      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)
      com.badlogic.gdx.math.Vector2 getTileDim()  
      com.badlogic.gdx.maps.tiled.TiledMap getTileMap()  
      void render()
      draws the first 2 layers
      void update()
      Updates the renderer's view with the rendering camera
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TileMap

        public TileMap​(int id,
                       RenderLayer layer)
        Parameters:
        id - resource id of the tilemap
        layer - rendering layer
    • Method Detail

      • 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
        Overrides:
        update in class Component
      • render

        public void render()
        draws the first 2 layers
        Overrides:
        render in class Component
      • cleanUp

        public void cleanUp()
        Description copied from class: Component
        Called once after the update loop has finished.
        Overrides:
        cleanUp in class Component