I would like to get the
absolute mouse position from the
Input class, because once I translate the input I can no longer get the absolute position of the mouse.
Code:
/**
* Get the absolute x position of the mouse cursor within the container
*
* @return The absolute x position of the mouse cursor
*/
public int getAbsoluteMouseX() {
return (int) Mouse.getX();
}
/**
* Get the absolute y position of the mouse cursor within the container
*
* @return The absolute y position of the mouse cursor
*/
public int getAbsoluteMouseY() {
return (int) height-Mouse.getY();
}
I'm not sure if scaling needs to be added?
I would of used Mouse.getY() but then noticed that the height was needed too..