Class WorldTilemapRenderer

java.lang.Object
com.devcharles.piazzapanic.utility.WorldTilemapRenderer

public class WorldTilemapRenderer extends Object
Renders a TiledMap that is loaded using MapLoader.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer
     
    private final com.badlogic.gdx.graphics.OrthographicCamera
     
    private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer
     
    private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer
     
    private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer
     
    private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer
     
    private final com.badlogic.gdx.maps.tiled.TiledMap
     
    (package private) final int
    Pixels per tile.
    private final com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer
     
    private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer
     
    private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldTilemapRenderer(com.badlogic.gdx.maps.tiled.TiledMap map, com.badlogic.gdx.graphics.OrthographicCamera mainCamera, com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
    Create a new renderer with existing TiledMap, camera and SpriteBatch.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    Render all layers that appear behind entities.
    void
    Render all layers that appear in front of entities.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • map

      private final com.badlogic.gdx.maps.tiled.TiledMap map
    • renderer

      private final com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer renderer
    • camera

      private final com.badlogic.gdx.graphics.OrthographicCamera camera
    • ppt

      final int ppt
      Pixels per tile. The tileset we are using is 32x32, so this effectively doubles apparent size.
      See Also:
    • floor

      private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer floor
    • front_wall

      private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer front_wall
    • station

      private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer station
    • countertop

      private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer countertop
    • back_wall

      private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer back_wall
    • countertop_f

      private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer countertop_f
    • station_f

      private final com.badlogic.gdx.maps.tiled.TiledMapTileLayer station_f
  • Constructor Details

    • WorldTilemapRenderer

      public WorldTilemapRenderer(com.badlogic.gdx.maps.tiled.TiledMap map, com.badlogic.gdx.graphics.OrthographicCamera mainCamera, com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Create a new renderer with existing TiledMap, camera and SpriteBatch. The renderer will not own any of these objects.
      Parameters:
      map - TiledMap instance with required layers, see constructor.
      mainCamera - camera to render to.
      batch - spritebatch to use.
  • Method Details

    • renderBackground

      public void renderBackground()
      Render all layers that appear behind entities.
    • renderForeground

      public void renderForeground()
      Render all layers that appear in front of entities.
    • dispose

      public void dispose()