Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

TiledMap not drawing completely [closed]

$
0
0

While attempting to constrain camera scrolling to within the TiledMap I discovered that it seems the renderer for the map is not drawing the entire map. The map is 1600x960px so one would assume the setting the camera position to 1600, 960, 0 would result in the top right corner of the map to be centered, however to actually center the map (I had to do some trial and error for this) the coordinates are closer to 1175, 740, 0.

The map is made of 25×15 tiles and each tile is 64x64px. I initialize the map and renderer like this:

    tileMap = new TmxMapLoader().load("maps/" + file);
    renderer = new OrthogonalTiledMapRenderer(tileMap, stage.getBatch());
    renderer.setView((OrthographicCamera) stage.getCamera());

Then to render I just call renderer.render().

Any idea why this could be happening and how to fix it?


Viewing all articles
Browse latest Browse all 434

Trending Articles