TileMapRenderer in libGDX not drawing anything

Posted by Benjamin Dengler on Game Development See other posts from Game Development or by Benjamin Dengler
Published on 2012-11-15T19:56:56Z Indexed on 2012/11/15 23:28 UTC
Read the original article Hit count: 333

Filed under:
|
|

So I followed the tutorial on the libGDX wiki to draw Tiled maps but it doesn't seem to render anything.

Here's how I setup my OrthographicCamera and load the map:

camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

map = TiledLoader.createMap(Gdx.files.internal("maps/test.tmx"));
atlas = new TileAtlas(map, Gdx.files.internal("maps"));
tileMapRenderer = new TileMapRenderer(map, atlas, 8, 8);

And here is my render function:

Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

camera.update();
tileMapRenderer.render(camera);

Also I did pack the tile map using the TiledMapPacker.

I'm completely stumped... am I missing anything obvious here?

EDIT:

While debugging I noticed that the TileAtlas seems to be empty, which I guess shouldn't be the case, but I have no idea why it's empty.

© Game Development or respective owner

Related posts about java

Related posts about tiles