My problem is that my FitViewport where i keep my game world, scales in a way that in the X axis i can see black bars, but the Y axis seems to not mind the Gdx.graphics limits and it goes out of the screen. What seems to be happening is that even though i pass it a World width and world height, it fits itself in a wrong way, not minding the Y axis at all.
PlayScreen constructor:
gameCamera = new OrthographicCamera();
gameCamera.setToOrtho(false);
gameViewport = new FitViewport(MyGame.WORLD_WIDTH,MyGame.WORLD_HEIGHT,gameCamera);
gameViewport.setScreenBounds(0,0,MyGame.WORLD_WIDTH,MyGame.WORLD_HEIGHT);
MyGame.java:
public static final int WORLD_WIDTH = 600;
public static final int WORLD_HEIGHT = 300;
render():
MyGame.batch.setProjectionMatrix(gameCamera.combined);
gameViewport.apply();
MyGame.batch.begin();
resize(int width, int height):
gameViewport.update(width,height);
gameCamera.position.set(player.position.x + 200,player.position.y, 0);