Originally posted by feiniao5643 July 20, 2022
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);
}
@Override
protected void onActionEnd() {
System.out.println(0);
FXGL.getGameScene().setFPSCamera(false);
}
},MouseButton.SECONDARY);`
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.
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4