I'm creating a simple 2D platformer and I have problem with my camera y position when I enter full screen mode. But first here's my code
screenY = Gdx.graphics.getHeight();
public void updateCamera(){
camera.position.x += (player1.getHitBox().x - camera.position.x);
if(screenY < player1.getHitBox().getY() && player1.getHitBox().getY() > (screenY - Gdx.graphics.getHeight())){
screenChanger++;
}else if(player1.getHitBox().getY() < (screenY - Gdx.graphics.getHeight())){
screenChanger--;
}
screenY = Gdx.graphics.getHeight() * screenChanger;
camera.position.y = (screenY - screenY/2);
camera.update();
System.out.println(Gdx.graphics.getHeight() + " " + screenY);
}
So here's my results: 1) When I start the game all works fine
2) But when I enter to fullscreen here what I get
3) here how it looks when I zoom out my camera