In my LibGdx game I have it using a ExtendedViewport
new ExtendViewport(LevelSmash.WIDTH, LevelSmash.HEIGHT, camera);
I set a width of 708, and height of 900,
In my render method i scale the spritebatch to the projection of the viewport
@Override
public void render(SpriteBatch sb) {
sb.setProjectionMatrix(vp.getCamera().projection);
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
sb.begin();
level.render(sb);
sb.end();
stage.act();
stage.draw();
}
The level's render method is
@Override
public void render(SpriteBatch sb) {
sb.setProjectionMatrix(vp.getCamera().projection);
sb.draw(background, 0 / LevelSmash.PPM, 0 / LevelSmash.PPM);
player.draw(sb);
}
PPM is equal to 100
I want the background to take the whole screen since its the width and height i scaled everything to (708, 900)
But it looks like this