use of com.badlogic.gdx.maps.tiled.TiledMapImageLayer in project libgdx by libgdx.
the class BatchTiledMapRenderer method render.
@Override
public void render() {
beginRender();
for (MapLayer layer : map.getLayers()) {
if (layer.isVisible()) {
if (layer instanceof TiledMapTileLayer) {
renderTileLayer((TiledMapTileLayer) layer);
} else if (layer instanceof TiledMapImageLayer) {
renderImageLayer((TiledMapImageLayer) layer);
} else {
renderObjects(layer);
}
}
}
endRender();
}
use of com.badlogic.gdx.maps.tiled.TiledMapImageLayer in project libgdx by libgdx.
the class BatchTiledMapRenderer method render.
@Override
public void render(int[] layers) {
beginRender();
for (int layerIdx : layers) {
MapLayer layer = map.getLayers().get(layerIdx);
if (layer.isVisible()) {
if (layer instanceof TiledMapTileLayer) {
renderTileLayer((TiledMapTileLayer) layer);
} else if (layer instanceof TiledMapImageLayer) {
renderImageLayer((TiledMapImageLayer) layer);
} else {
renderObjects(layer);
}
}
}
endRender();
}
use of com.badlogic.gdx.maps.tiled.TiledMapImageLayer in project libgdx by libgdx.
the class OrthoCachedTiledMapRenderer method render.
@Override
public void render(int[] layers) {
if (!cached) {
cached = true;
count = 0;
spriteCache.clear();
final float extraWidth = viewBounds.width * overCache;
final float extraHeight = viewBounds.height * overCache;
cacheBounds.x = viewBounds.x - extraWidth;
cacheBounds.y = viewBounds.y - extraHeight;
cacheBounds.width = viewBounds.width + extraWidth * 2;
cacheBounds.height = viewBounds.height + extraHeight * 2;
for (MapLayer layer : map.getLayers()) {
spriteCache.beginCache();
if (layer instanceof TiledMapTileLayer) {
renderTileLayer((TiledMapTileLayer) layer);
} else if (layer instanceof TiledMapImageLayer) {
renderImageLayer((TiledMapImageLayer) layer);
}
spriteCache.endCache();
}
}
if (blending) {
Gdx.gl.glEnable(GL20.GL_BLEND);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}
spriteCache.begin();
MapLayers mapLayers = map.getLayers();
for (int i : layers) {
MapLayer layer = mapLayers.get(i);
if (layer.isVisible()) {
spriteCache.draw(i);
renderObjects(layer);
}
}
spriteCache.end();
if (blending)
Gdx.gl.glDisable(GL20.GL_BLEND);
}
use of com.badlogic.gdx.maps.tiled.TiledMapImageLayer in project libgdx by libgdx.
the class OrthoCachedTiledMapRenderer method render.
@Override
public void render() {
if (!cached) {
cached = true;
count = 0;
spriteCache.clear();
final float extraWidth = viewBounds.width * overCache;
final float extraHeight = viewBounds.height * overCache;
cacheBounds.x = viewBounds.x - extraWidth;
cacheBounds.y = viewBounds.y - extraHeight;
cacheBounds.width = viewBounds.width + extraWidth * 2;
cacheBounds.height = viewBounds.height + extraHeight * 2;
for (MapLayer layer : map.getLayers()) {
spriteCache.beginCache();
if (layer instanceof TiledMapTileLayer) {
renderTileLayer((TiledMapTileLayer) layer);
} else if (layer instanceof TiledMapImageLayer) {
renderImageLayer((TiledMapImageLayer) layer);
}
spriteCache.endCache();
}
}
if (blending) {
Gdx.gl.glEnable(GL20.GL_BLEND);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}
spriteCache.begin();
MapLayers mapLayers = map.getLayers();
for (int i = 0, j = mapLayers.getCount(); i < j; i++) {
MapLayer layer = mapLayers.get(i);
if (layer.isVisible()) {
spriteCache.draw(i);
renderObjects(layer);
}
}
spriteCache.end();
if (blending)
Gdx.gl.glDisable(GL20.GL_BLEND);
}
Aggregations