How to use setFPSCamera method of GameScene #1185
feiniao5643
started this conversation in
General
Replies: 2 comments
-
Thanks, I reproduced this and will try to figure out why. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Right, the issue was with the mouse buttons being pressed (which fired MOUSE_DRAGGED rather than MOUSE_MOVED). It is now fixed, thanks for raising this. Your code above should now work fine. To get the latest build, you can use this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all, please forgive me for my bad English.
I'll skip the usual preliminaries and come straight to the point.
I use this API in initGame,It's normal.
@Override protected void initGame() { camera3D = FXGL.getGameScene().getCamera3D(); FXGL.getGameWorld().addEntityFactory(new GameEntityFactory()); camera3D.setMoveSpeed(500); camera3D.getTransform().setZ(-200); camera3D.getTransform().setAngle(30); **FXGL.getGameScene().setFPSCamera(true);** FXGL.spawn("铁骑兵",0,0,0); }
But I can't use it in mouse events.
`FXGL.getInput().addAction(new UserAction("Mouse Turn") {
@OverRide
protected void onActionBegin() {
FXGL.getGameScene().setFPSCamera(true);
}
Finally, the function I want to achieve is that when the right mouse button is pressed, the camera moves with the mouse, and the camera is fixed after release.
Beta Was this translation helpful? Give feedback.
All reactions