Im using Tiled map editor, Hexagonal(staggered) map, libgdx version 1.9.9

If I set staggeredIndex = even in tiled map editor, libgdx seems to render odd

If I set it to odd in map editor, libgdx renders even

Screen Shots: enter image description here enter image description here

Here's the code:

public void create () {
    map = new TmxMapLoader().load("mapa.tmx");
    cam = new OrthographicCamera(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()); 
    mapRenderer = new HexagonalTiledMapRenderer(map);


public void render () {
    Gdx.gl.glClearColor(0, 0, 0, 1);


1 Answer 1


Since I found the problem ima go ahead an answer my own question.

The tile(0,0) in Tiled is in top-left corner while in libgdx tile(0,0) is down-left corner.

This is why staggeredY axis causes problem in a map where the height is even like 10 tiles, in the map editor the first row is even and the last row is odd in libgdx the last row is actually the first row, so its even.

Solution: Make the map height odd, instead of 10 tiles I made it 11. You could make small changes to HexagonalTiledMapRenderer like

if(mapHeight % 2 === 0)
  staggerIndex = !staggerIndex

I just didn't mind adding an extra row.

I personally think they should correct this in libgdx


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .