APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.maps.tiled.renderers

public Class HexagonalTiledMapRenderer

extends BatchTiledMapRenderer
Class Inheritance
Static Imports
com.badlogic.gdx.graphics.g2d.Batch.*

Field Summary

Modifier and TypeField and Description
private float
hexSideLength

the parameter defining the shape of the hexagon from tiled.

private boolean
staggerAxisX

true for X-Axis, false for Y-Axis

private boolean
staggerIndexEven

true for even StaggerIndex, false for odd

Inherited from com.badlogic.gdx.maps.tiled.renderers.BatchTiledMapRenderer:
batchimageBoundsmapNUM_VERTICESownsBatchrepeatedImageBoundsunitScaleverticesviewBounds

Constructor Summary

AccessConstructor and Description
public
public
HexagonalTiledMapRenderer(TiledMap map, float unitScale)

public
public
HexagonalTiledMapRenderer(TiledMap map, float unitScale, Batch batch)

Method Summary

Modifier and TypeMethod and Description
public float
private void
public boolean
public boolean
private void
renderCell(final TiledMapTileLayer.Cell cell, final float x, final float y, final float color)

render a single cell

public void
public void
public void
setHexSideLength(float hexSideLength)

public void
setStaggerAxisX(boolean staggerAxisX)

public void
setStaggerIndexEven(boolean staggerIndexEven)

Inherited from com.badlogic.gdx.maps.tiled.renderers.BatchTiledMapRenderer:
beginRenderdisposeendRendergetBatchgetImageLayerColorgetMapgetTileLayerColorgetUnitScalegetViewBoundsrenderrenderrenderMapLayerrenderObjectrenderObjectssetMapsetViewsetView

Field Detail

hexSideLengthback to summary
private float hexSideLength

the parameter defining the shape of the hexagon from tiled. more specifically it represents the length of the sides that are parallel to the stagger axis. e.g. with respect to the stagger axis a value of 0 results in a rhombus shape, while a value equal to the tile length/height represents a square shape and a value of 0.5 represents a regular hexagon if tile length equals tile height

staggerAxisXback to summary
private boolean staggerAxisX

true for X-Axis, false for Y-Axis

staggerIndexEvenback to summary
private boolean staggerIndexEven

true for even StaggerIndex, false for odd

Constructor Detail

HexagonalTiledMapRendererback to summary
public HexagonalTiledMapRenderer(TiledMap map)
HexagonalTiledMapRendererback to summary
public HexagonalTiledMapRenderer(TiledMap map, float unitScale)
HexagonalTiledMapRendererback to summary
public HexagonalTiledMapRenderer(TiledMap map, Batch batch)
HexagonalTiledMapRendererback to summary
public HexagonalTiledMapRenderer(TiledMap map, float unitScale, Batch batch)

Method Detail

getHexSideLengthback to summary
public float getHexSideLength()
initback to summary
private void init(TiledMap map)
isStaggerAxisXback to summary
public boolean isStaggerAxisX()
isStaggerIndexEvenback to summary
public boolean isStaggerIndexEven()
renderCellback to summary
private void renderCell(final TiledMapTileLayer.Cell cell, final float x, final float y, final float color)

render a single cell

renderImageLayerback to summary
public void renderImageLayer(TiledMapImageLayer layer)

Overrides com.badlogic.gdx.maps.tiled.renderers.BatchTiledMapRenderer.renderImageLayer.

Implements com.badlogic.gdx.maps.tiled.TiledMapRenderer.renderImageLayer.

Annotations
@Override
renderTileLayerback to summary
public void renderTileLayer(TiledMapTileLayer layer)

Implements com.badlogic.gdx.maps.tiled.TiledMapRenderer.renderTileLayer.

Annotations
@Override
setHexSideLengthback to summary
public void setHexSideLength(float hexSideLength)
setStaggerAxisXback to summary
public void setStaggerAxisX(boolean staggerAxisX)
setStaggerIndexEvenback to summary
public void setStaggerIndexEven(boolean staggerIndexEven)