📜  libgdx 使用触摸移动相机 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:16.499000             🧑  作者: Mango

代码示例1
@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
    //difference between the current pointer location and the last pointer location on X axis
    float x = Gdx.input.getDeltaX();
    //difference between the current pointer location and the last pointer location on Y axis
    float y = Gdx.input.getDeltaY();

    camera.translate(-x,y);
    return true;
}