A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AlmasB/FXGL/issues/1189 below:

setFPSCamera method of GameScene in input events · Issue #1189 · AlmasB/FXGL · GitHub

Skip to content Navigation Menu

Saved searches Use saved searches to filter your results more quickly

Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Additional navigation options

setFPSCamera method of GameScene in input events #1189

Description Discussed in #1185

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