Search in sources :

Example 6 with AdvancedCamera

use of org.fxyz.cameras.AdvancedCamera in project FXyzLib by Birdasaur.

the class CameraController method setCamera.

public void setCamera(AdvancedCamera camera) {
    this.camera = camera;
    switch(animPref) {
        case TIMELINE:
            timeline.getKeyFrames().addAll(new KeyFrame(Duration.millis(15), e -> {
                new Timeline(new KeyFrame[] { new KeyFrame(Duration.ONE, ev -> {
                    update();
                }) }).play();
            }));
            timeline.play();
            break;
        case TIMER:
            timer.start();
            break;
        case TRANSITION:
            transition.play();
            break;
        case ANIMATION:
            break;
    }
}
Also used : Scene(javafx.scene.Scene) KeyFrame(javafx.animation.KeyFrame) MouseEvent(javafx.scene.input.MouseEvent) AnimationPreference(org.fxyz.utils.AnimationPreference) Timeline(javafx.animation.Timeline) KeyEvent(javafx.scene.input.KeyEvent) ScrollEvent(javafx.scene.input.ScrollEvent) Transition(javafx.animation.Transition) AdvancedCamera(org.fxyz.cameras.AdvancedCamera) MIDDLE(javafx.scene.input.MouseButton.MIDDLE) SECONDARY(javafx.scene.input.MouseButton.SECONDARY) Transformable(org.fxyz.extras.Transformable) AnimationTimer(javafx.animation.AnimationTimer) Duration(javafx.util.Duration) Point2D(javafx.geometry.Point2D) Animation(javafx.animation.Animation) SubScene(javafx.scene.SubScene) PRIMARY(javafx.scene.input.MouseButton.PRIMARY) Timeline(javafx.animation.Timeline) KeyFrame(javafx.animation.KeyFrame)

Aggregations

Scene (javafx.scene.Scene)6 AdvancedCamera (org.fxyz.cameras.AdvancedCamera)6 FPSController (org.fxyz.cameras.controllers.FPSController)5 StackPane (javafx.scene.layout.StackPane)4 Random (java.util.Random)3 Group (javafx.scene.Group)3 Color (javafx.scene.paint.Color)3 Rotate (javafx.scene.transform.Rotate)3 Translate (javafx.scene.transform.Translate)3 KeyCode (javafx.scene.input.KeyCode)2 Animation (javafx.animation.Animation)1 AnimationTimer (javafx.animation.AnimationTimer)1 KeyFrame (javafx.animation.KeyFrame)1 Timeline (javafx.animation.Timeline)1 Transition (javafx.animation.Transition)1 Point2D (javafx.geometry.Point2D)1 SubScene (javafx.scene.SubScene)1 KeyEvent (javafx.scene.input.KeyEvent)1 MIDDLE (javafx.scene.input.MouseButton.MIDDLE)1 PRIMARY (javafx.scene.input.MouseButton.PRIMARY)1