Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
Hello, I can't help you with it, but I'll leave you with a working sample so you can work from there in case you have not seem it already... Sample Link . Also, the resources used: Resources used –  AranHase Nov 15 '12 at 20:04
    
Thanks. The example doesn't work for me either... even with the resources you linked to. So either the renderer is broken in the latest release or there's something wrong with my system... –  Benjamin Dengler Nov 15 '12 at 20:23
    
I just tried it here, and is working. Did you got any error while trying to run the project? (Ps.: I'm using the tmx map I linked above) –  AranHase Nov 15 '12 at 20:37
    
Unfortunately not... Just a black screen with red text. –  Benjamin Dengler Nov 15 '12 at 20:39
    
Okay i found out what the problem was... I feel really stupid now :) Apparently when using the standard libgdx project structure in eclipse you have to refresh the android project before the base project can access the resources... still strange that i didn't get any errors though... –  Benjamin Dengler Nov 15 '12 at 20:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.