I'm working at a android game using LIBGDX.
@Override
public boolean touchDown(int x, int y, int pointer, int button) {
// TODO Auto-generated method stub
return false;
}
Here, the x and y returns the position of the touch of the device screen, and the values are between 0 and the device screen width and height.
My game resolution is 800x480, and it will keep its aspect ratio on every device. I want to find out a way to get the touch position, related to the game rectangle, this image can explain exactly:
Is there a way to do it? I want to get the touch position related to my viewport.. I use this to keep the aspect ratio http://www.java-gaming.org/index.php?topic=25685.0