Camera LibGDX

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

Without reading your code, maybe translate the camera negative half the screen width and height?
camera.translate(Gdx.graphics.getWidth() / -2, Gdx.graphics.getHeight() / -2)

My map has just completly disappeared ^^

I can’t search more today sorry, i go to sleep !
Bye

Because you zoom?

cam.zoom = 0.3f;

OT: I think this is wrong section to post.

Not, i tried without zoom
I post a new subgect in the right section sorry

If someone can delete this ^^

I use the .render slightly differently:

Parameters:
cam The camera to use
layers The list of layers to draw, 0 being the lowest layer. You will get an IndexOutOfBoundsException if a layer number is too high.


// Background / Foreground Layer
tileMapRenderer.render(this.getCam(), new int[] { 0, 1 });

// Render some other stuff

// TOP LAYER
tileMapRenderer.render(this.getCam(), new int[] { 2 });

Have you properly packaged your map? Generated the packfile etc?