如何在 LibGdx 中更改相机的位置?



我想知道为什么我的OrthographicCamera不动。这是我使用的代码:

world.getPlayer().setX(world.getPlayer().getX()-0.05f);
camera.position.set(camera.position.x-0.5f, camera.position.y, camera.position.z);
camera.update();

在渲染方法中,将摄像机投影矩阵设置为组合。

batch.setProjectionMatrix(camera.combined);//batch is the name of the spritebatch

最新更新