Examples of MotionBlur


Examples of javafx.scene.effect.MotionBlur

     */
    protected Animation buildHorizontalAnimation(final double fromX, final double toX, final double fromY, final double toY) {

        final double angle = findAngle(fromX, toX, fromY, toY);

        final MotionBlur mb = MotionBlurBuilder.create().angle(angle).build();
        getRootNode().setEffect(mb);

        return ParallelTransitionBuilder.create()
                .children(
                        TranslateTransitionBuilder.create()
                                .node(getRootNode())
                                .fromX(fromX)
                                .toX(toX)
                                .fromY(fromY)
                                .toY(toY)
                                .duration(Duration.seconds(1))
                                .build(),

                        TimelineBuilder.create()
                                .keyFrames(
                                        new KeyFrame(Duration.millis(0), new KeyValue(mb.radiusProperty(), 0)),
                                        new KeyFrame(Duration.millis(100), new KeyValue(mb.radiusProperty(), 50)),
                                        new KeyFrame(Duration.millis(500), new KeyValue(mb.radiusProperty(), 63)),
                                        new KeyFrame(Duration.millis(900), new KeyValue(mb.radiusProperty(), 50)),
                                        new KeyFrame(Duration.millis(1000), new KeyValue(mb.radiusProperty(), 0))
                                )
                                .build()
                )
                .build();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.