@Override public boolean touchDragged(int x, int y, int pointer) { if (draggedSprite != null) { float dx = (x - lastX) * camera.viewportWidth / Gdx.graphics.getWidth(); float dy = (lastY - y) * camera.viewportHeight / Gdx.graphics.getHeight(); draggedSprite.translate(dx, dy); } lastX = x; lastY = y; return true; }