What I want to do is have a virtual size for my world and scale that world on the screen as much as possible without changing the aspect ratio, the FitViewport seemed like the best candidate. Thats how I intialised my viewport on the stage.
public class PlayStage extends Stage{
public static final int WIDTH = 480;
public static final int HEIGHT = 800;
private final Vector2 gravity = new Vector2(0.f, -9.8f);
private World physWorld;
public PlayStage(){
super();
OrthographicCamera camera = new OrthographicCamera();
camera.setToOrtho(false, WIDTH, HEIGHT);
setViewport(new FitViewport(WIDTH, HEIGHT, camera));
physWorld = new World(gravity, false);
Gdx.input.setInputProcessor(this);
Ball ball = new Ball(physWorld);
setKeyboardFocus(ball);
addActor(ball);
}
@Override
public void draw() {
super.draw();
}
@Override
public void act(float delta) {
super.act(delta);
physWorld.step(delta, 10, 5);
}
@Override
public void dispose() {
super.dispose();
physWorld.dispose();
}}
This is how the sprite looks when rendered (scaled too much on the x coordinate). Also I get no touch down events for my actors.