Class WorldTilemapRenderer
java.lang.Object
com.devcharles.piazzapanic.utility.WorldTilemapRenderer
Renders a
TiledMap
that is loaded using MapLoader
.-
Field Summary
Modifier and TypeFieldDescriptionprivate 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
ConstructorDescriptionWorldTilemapRenderer
(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 existingTiledMap
, camera andSpriteBatch
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
void
Render all layers that appear behind entities.void
Render all layers that appear in front of entities.
-
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 pptPixels 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 existingTiledMap
, camera andSpriteBatch
. 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()
-