How to fix the character flip when using an orthographic camera in libGDX

I used an orthographic camera to follow the character (player), but the problem is that my character is flipped. There are no tutorials on how to fix this. Please help as fast as possible.

Here is my create method:

public void create () {

    batch = new SpriteBatch();
float width=Gdx.graphics.getWidth();
float height=Gdx.graphics.getHeight();
camera=new OrthographicCamera();
camera.setToOrtho(false,width,height);
camera.update();
tiledMapRenderer=new OrthogonalTiledMapRenderer(tiledMap);
player=new Player(new Vector2(0,0));
sr= new ShapeRenderer();


}

Here is my render method: public void render () {

    Gdx.gl.glClearColor(0, 0, 0.2f, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA,GL20.GL_ONE_MINUS_SRC_ALPHA);
player.update();
camera.position.set(player.getPosition().x,player.getPosition().y,0);
camera.update();
tiledMapRenderer.setView(camera);
tiledMapRenderer.render();
sr.begin(ShapeRenderer.ShapeType.Line);
sr.setColor(Color.BLUE);
sr.rect(player.getPosition().x,player.getPosition().y,player.getCurrentFrame().getRegionWidth(),player.getCurrentFrame().getRegionHeight());

sr.end();
batch.begin();

batch.draw(player.getCurrentFrame(),player.getPosition().x, player.getPosition().y);
batch.setProjectionMatrix(camera.combined);
batch.end();
}

• Can you add some screenshot? What you mean "flipped"? – admund Jan 28 '15 at 12:19
• @AdmunD i add a screenshot – Omar Taher Jan 30 '15 at 6:21
• Try changing the first parameter of camera.setToOrtho to true. If I remember correctly this is the flip y parameter. – tom van green Jan 30 '15 at 7:08

It's been a bit since I used LibGDX, but doesn't the setToOrtho function have a boolean that defines whether the camera is flipped or not? It looks like your whole screenshot is flipped, so instead of camera.setToOrtho(false, width, height); try using camera.setToOrtho(true, width, height);.
If it is just the player that is flipped (which I'm guessing is a sprite), you can just use player.flip(false, true) to flip it vertically.