I have implemented some screens using libGDX that would obviously use the Screen class provided by the libGDX framework. However, the implementation for these s
I'm using that method from http://blog.acamara.es/2012/02/05/keep-screen-aspect-ratio-with-different-resolutions-using-libgdx/
I made this function that returns the point on the screen touched, scaled down to the game position you want.
public Vector2 getScaledPos(float x, float y) {
float yR = viewport.height / (y - viewport.y);
y = CAMERA_HEIGHT / yR;
float xR = viewport.width / (x - viewport.x);
x = CAMERA_WIDTH / xR;
return new Vector2(x, CAMERA_HEIGHT - y);
}
Use this in the touchdown / up/ drag and you can check for touch in your game.