Hello,
Can someone tell me why my map is not rendering in the full camera view?
My code:
private TileMapRenderer tileMapRenderer;
private TiledMap map;
private TileAtlas atlas;
private OrthographicCamera cam;
public Map(){
// Load the tmx file into map
map = TiledLoader.createMap(Gdx.files.internal("data/testMap.tmx"));
// Load the tiles into atlas
atlas = new TileAtlas(map, Gdx.files.internal("data/"));
// Create the renderer
tileMapRenderer = new TileMapRenderer(map, atlas,32, 32, 5, 5);
//initialize
cam = new OrthographicCamera(Gdx.graphics.getWidth(),
Gdx.graphics.getHeight());
cam.position.set(0, 0, 0);
}
public void render() {
cam.zoom = 0.3f;
cam.update();
tileMapRenderer.getProjectionMatrix().set(cam.combined);
Vector3 tmp = new Vector3();
tmp.set(0, 0, 0);
cam.unproject(tmp);
tileMapRenderer.render( tmp.x, tmp.y,
Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
}
Thanks
ps : sorry for my english