Code example for Display

Methods: getRotation

     * Depending on the default way you hold a device, the coordinates might be 
     * swapped. This method makes sure that the sensor data is mapped to the 
     * coordinate system of the current game screen. 
    private SensorData mapToScreenCoordinates(SensorData data) {
        switch (display.getRotation()) {
        case Surface.ROTATION_90:
            return new SensorData(data.y, -data.x);
        case Surface.ROTATION_180:
            return new SensorData(-data.x, -data.y);
        case Surface.ROTATION_270:
            return new SensorData(-data.y, data.x);
        case Surface.ROTATION_0:
            return new SensorData(data.x, data.y);