javafx.scene.effect.GaussianBlur Java Examples

The following examples show how to use javafx.scene.effect.GaussianBlur. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Transitions.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void removeEffect(Node node, int duration) {
    if (node != null) {
        node.setMouseTransparent(false);
        removeEffectTimeLine = new Timeline();
        GaussianBlur blur = (GaussianBlur) node.getEffect();
        if (blur != null) {
            KeyValue kv1 = new KeyValue(blur.radiusProperty(), 0.0);
            KeyFrame kf1 = new KeyFrame(Duration.millis(getDuration(duration)), kv1);
            removeEffectTimeLine.getKeyFrames().add(kf1);

            ColorAdjust darken = (ColorAdjust) blur.getInput();
            KeyValue kv2 = new KeyValue(darken.brightnessProperty(), 0.0);
            KeyFrame kf2 = new KeyFrame(Duration.millis(getDuration(duration)), kv2);
            removeEffectTimeLine.getKeyFrames().add(kf2);
            removeEffectTimeLine.setOnFinished(actionEvent -> {
                node.setEffect(null);
                removeEffectTimeLine = null;
            });
            removeEffectTimeLine.play();
        } else {
            node.setEffect(null);
            removeEffectTimeLine = null;
        }
    }
}
 
Example #2
Source File: MKXMenuApp.java    From FXTutorials with MIT License 6 votes vote down vote up
public TriCircle() {
    Shape shape1 = Shape.subtract(new Circle(5), new Circle(2));
    shape1.setFill(Color.WHITE);

    Shape shape2 = Shape.subtract(new Circle(5), new Circle(2));
    shape2.setFill(Color.WHITE);
    shape2.setTranslateX(5);

    Shape shape3 = Shape.subtract(new Circle(5), new Circle(2));
    shape3.setFill(Color.WHITE);
    shape3.setTranslateX(2.5);
    shape3.setTranslateY(-5);

    getChildren().addAll(shape1, shape2, shape3);

    setEffect(new GaussianBlur(2));
}
 
Example #3
Source File: FxIconBuilder.java    From FxDock with Apache License 2.0 6 votes vote down vote up
protected Effect setInputEffect(Effect a, Effect b)
{
	// I don't know a better way to chain effects, it's missing in FX
	// https://bugs.openjdk.java.net/browse/JDK-8091895
	// perhaps try Blend:
	// https://community.oracle.com/thread/2337194?tstart=0
	if(b instanceof GaussianBlur)
	{
		((GaussianBlur)b).setInput(a);
	}
	else if(b instanceof ColorAdjust)
	{
		((ColorAdjust)b).setInput(a);
	}
	else
	{
		throw new Error("todo: does " + b + " have setInput()?"); 
	}
	return b;
}
 
Example #4
Source File: CenterArc.java    From CrazyAlpha with GNU General Public License v2.0 6 votes vote down vote up
public CenterArc() {
    fillColor = Color.color(Math.random(), Math.random(), Math.random());
    strokeColor = Color.YELLOW;
    width = 120;
    height = 120;
    x = (Game.getInstance().getRender().getWidth() - width) / 2;
    y = (Game.getInstance().getRender().getHeight() - height) / 2;
    for (int i = 0; i < 4; i++) {
        Arc arc = new Arc(x, y, width, height, i * 90, 30);
        arc.setType(ArcType.ROUND);
        shapes.add(arc);
    }
    effect = new GaussianBlur();

    start();
}
 
Example #5
Source File: GuiUtils.java    From GreenBits with GNU General Public License v3.0 5 votes vote down vote up
public static void blurOut(Node node) {
    GaussianBlur blur = new GaussianBlur(0.0);
    node.setEffect(blur);
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 10.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.play();
}
 
Example #6
Source File: MenuItem.java    From FXTutorials with MIT License 5 votes vote down vote up
public MenuItem(String name, int width) {
    setAlignment(Pos.CENTER_LEFT);

    text = new Text(name);
    text.setTranslateX(5);
    text.setFont(font);
    text.setFill(Colors.MENU_TEXT);
    text.setStroke(Color.BLACK);

    shadow = new DropShadow(5, Color.BLACK);
    text.setEffect(shadow);

    selection = new Rectangle(width - 45, 30);
    selection.setFill(Colors.MENU_ITEM_SELECTION);
    selection.setStroke(Color.BLACK);
    selection.setVisible(false);

    GaussianBlur blur = new GaussianBlur(8);
    selection.setEffect(blur);

    getChildren().addAll(selection, text);

    setOnMouseEntered(e -> {
        onSelect();
    });

    setOnMouseExited(e -> {
        onDeselect();
    });

    setOnMousePressed(e -> {
        text.setFill(Color.YELLOW);
    });
}
 
Example #7
Source File: Civ6MenuItem.java    From FXTutorials with MIT License 5 votes vote down vote up
public Civ6MenuItem(String name) {
    Polygon bg = new Polygon(
            0, 0,
            200, 0,
            215, 15,
            200, 30,
            0, 30
    );
    bg.setStroke(Color.color(1, 1, 1, 0.75));
    bg.setEffect(new GaussianBlur());

    bg.fillProperty().bind(
            Bindings.when(pressedProperty())
                    .then(Color.color(0, 0, 0, 0.75))
                    .otherwise(Color.color(0, 0, 0, 0.25))
    );

    text = new Text(name);
    text.setTranslateX(5);
    text.setTranslateY(20);
    text.setFont(Font.loadFont(Civ6MenuApp.class.getResource("res/Penumbra-HalfSerif-Std_35114.ttf").toExternalForm(), 14));
    text.setFill(Color.WHITE);

    text.effectProperty().bind(
            Bindings.when(hoverProperty())
                    .then(shadow)
                    .otherwise(blur)
    );

    getChildren().addAll(bg, text);
}
 
Example #8
Source File: MKXMenuApp.java    From FXTutorials with MIT License 5 votes vote down vote up
public MenuItem(String name) {
    super(15);
    setAlignment(Pos.CENTER);

    text = new Text(name);
    text.setFont(FONT);
    text.setEffect(new GaussianBlur(2));

    getChildren().addAll(c1, text, c2);
    setActive(false);
    setOnActivate(() -> System.out.println(name + " activated"));
}
 
Example #9
Source File: GameMenuDemo.java    From FXTutorials with MIT License 5 votes vote down vote up
public MenuButton(String name) {
    text = new Text(name);
    text.setFont(text.getFont().font(20));
    text.setFill(Color.WHITE);

    Rectangle bg = new Rectangle(250, 30);
    bg.setOpacity(0.6);
    bg.setFill(Color.BLACK);
    bg.setEffect(new GaussianBlur(3.5));

    setAlignment(Pos.CENTER_LEFT);
    setRotate(-0.5);
    getChildren().addAll(bg, text);

    setOnMouseEntered(event -> {
        bg.setTranslateX(10);
        text.setTranslateX(10);
        bg.setFill(Color.WHITE);
        text.setFill(Color.BLACK);
    });

    setOnMouseExited(event -> {
        bg.setTranslateX(0);
        text.setTranslateX(0);
        bg.setFill(Color.BLACK);
        text.setFill(Color.WHITE);
    });

    DropShadow drop = new DropShadow(50, Color.WHITE);
    drop.setInput(new Glow());

    setOnMousePressed(event -> setEffect(drop));
    setOnMouseReleased(event -> setEffect(null));
}
 
Example #10
Source File: ImageMosaicStep.java    From TweetwallFX with MIT License 5 votes vote down vote up
private Transition createMosaicTransition(final List<ImageStore> imageStores) {
    final SequentialTransition fadeIn = new SequentialTransition();
    final List<FadeTransition> allFadeIns = new ArrayList<>();
    final double width = pane.getWidth() / 6.0 - 10;
    final double height = pane.getHeight() / 5.0 - 8;
    final List<ImageStore> distillingList = new ArrayList<>(imageStores);

    for (int i = 0; i < 6; i++) {
        for (int j = 0; j < 5; j++) {
            int index = RANDOM.nextInt(distillingList.size());
            ImageStore selectedImage = distillingList.remove(index);
            ImageView imageView = new ImageView(selectedImage.getImage());
            imageView.setCache(true);
            imageView.setCacheHint(CacheHint.SPEED);
            imageView.setFitWidth(width);
            imageView.setFitHeight(height);
            imageView.setEffect(new GaussianBlur(0));
            rects[i][j] = imageView;
            bounds[i][j] = new BoundingBox(i * (width + 10) + 5, j * (height + 8) + 4, width, height);
            rects[i][j].setOpacity(0);
            rects[i][j].setLayoutX(bounds[i][j].getMinX());
            rects[i][j].setLayoutY(bounds[i][j].getMinY());
            pane.getChildren().add(rects[i][j]);
            FadeTransition ft = new FadeTransition(Duration.seconds(0.3), imageView);
            ft.setToValue(1);
            allFadeIns.add(ft);
        }
    }
    Collections.shuffle(allFadeIns);
    fadeIn.getChildren().addAll(allFadeIns);
    return fadeIn;
}
 
Example #11
Source File: BlurTransition.java    From TweetwallFX with MIT License 5 votes vote down vote up
private BlurTransition(
        final Duration duration,
        final GaussianBlur blur,
        double startRadius,
        double targetRadius) {
    setCycleDuration(duration);
    this.blur = blur;
    this.startRadius = startRadius;
    this.targetRadius = targetRadius;
}
 
Example #12
Source File: GuiUtils.java    From thundernetwork with GNU Affero General Public License v3.0 5 votes vote down vote up
public static void blurIn(Node node) {
    GaussianBlur blur = (GaussianBlur) node.getEffect();
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 0.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.setOnFinished(actionEvent -> node.setEffect(null));
    timeline.play();
}
 
Example #13
Source File: GuiUtils.java    From thundernetwork with GNU Affero General Public License v3.0 5 votes vote down vote up
public static void blurOut(Node node) {
    GaussianBlur blur = new GaussianBlur(0.0);
    node.setEffect(blur);
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 10.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.play();
}
 
Example #14
Source File: GuiUtils.java    From devcoretalk with GNU General Public License v2.0 5 votes vote down vote up
public static void blurIn(Node node) {
    GaussianBlur blur = (GaussianBlur) node.getEffect();
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 0.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.setOnFinished(actionEvent -> node.setEffect(null));
    timeline.play();
}
 
Example #15
Source File: GuiUtils.java    From devcoretalk with GNU General Public License v2.0 5 votes vote down vote up
public static void blurOut(Node node) {
    GaussianBlur blur = new GaussianBlur(0.0);
    node.setEffect(blur);
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 10.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.play();
}
 
Example #16
Source File: GuiUtils.java    From GreenBits with GNU General Public License v3.0 5 votes vote down vote up
public static void blurIn(Node node) {
    GaussianBlur blur = (GaussianBlur) node.getEffect();
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 0.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.setOnFinished(actionEvent -> node.setEffect(null));
    timeline.play();
}
 
Example #17
Source File: GuiUtils.java    From thunder with GNU Affero General Public License v3.0 5 votes vote down vote up
public static void blurIn (Node node) {
    GaussianBlur blur = (GaussianBlur) node.getEffect();
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 0.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.setOnFinished(actionEvent -> node.setEffect(null));
    timeline.play();
}
 
Example #18
Source File: GuiUtils.java    From thunder with GNU Affero General Public License v3.0 5 votes vote down vote up
public static void blurOut (Node node) {
    GaussianBlur blur = new GaussianBlur(0.0);
    node.setEffect(blur);
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 10.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.play();
}
 
Example #19
Source File: StopWatch.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void configureBackground() {
    ImageView imageView = new ImageView();
    Image image = loadImage();
    imageView.setImage(image);

    Circle circle1 = new Circle();
    circle1.setCenterX(140);
    circle1.setCenterY(140);
    circle1.setRadius(120);
    circle1.setFill(Color.TRANSPARENT);
    circle1.setStroke(Color.web("#0A0A0A"));
    circle1.setStrokeWidth(0.3);

    Circle circle2 = new Circle();
    circle2.setCenterX(140);
    circle2.setCenterY(140);
    circle2.setRadius(118);
    circle2.setFill(Color.TRANSPARENT);
    circle2.setStroke(Color.web("#0A0A0A"));
    circle2.setStrokeWidth(0.3);

    Circle circle3 = new Circle();
    circle3.setCenterX(140);
    circle3.setCenterY(140);
    circle3.setRadius(140);
    circle3.setFill(Color.TRANSPARENT);
    circle3.setStroke(Color.web("#818a89"));
    circle3.setStrokeWidth(1);

    Ellipse ellipse = new Ellipse(140, 95, 180, 95);
    Circle ellipseClip = new Circle(140, 140, 140);
    ellipse.setFill(Color.web("#535450"));
    ellipse.setStrokeWidth(0);
    GaussianBlur ellipseEffect = new GaussianBlur();
    ellipseEffect.setRadius(10);
    ellipse.setEffect(ellipseEffect);
    ellipse.setOpacity(0.1);
    ellipse.setClip(ellipseClip);
    background.getChildren().addAll(imageView, circle1, circle2, circle3, ellipse);
}
 
Example #20
Source File: StopWatchSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
private void configureBackground() {
    ImageView imageView = new ImageView();
    Image image = loadImage();
    imageView.setImage(image);

    Circle circle1 = new Circle();
    circle1.setCenterX(140);
    circle1.setCenterY(140);
    circle1.setRadius(120);
    circle1.setFill(Color.TRANSPARENT);
    circle1.setStroke(Color.web("#0A0A0A"));
    circle1.setStrokeWidth(0.3);

    Circle circle2 = new Circle();
    circle2.setCenterX(140);
    circle2.setCenterY(140);
    circle2.setRadius(118);
    circle2.setFill(Color.TRANSPARENT);
    circle2.setStroke(Color.web("#0A0A0A"));
    circle2.setStrokeWidth(0.3);

    Circle circle3 = new Circle();
    circle3.setCenterX(140);
    circle3.setCenterY(140);
    circle3.setRadius(140);
    circle3.setFill(Color.TRANSPARENT);
    circle3.setStroke(Color.web("#818a89"));
    circle3.setStrokeWidth(1);

    Ellipse ellipse = new Ellipse(140, 95, 180, 95);
    Circle ellipseClip = new Circle(140, 140, 140);
    ellipse.setFill(Color.web("#535450"));
    ellipse.setStrokeWidth(0);
    GaussianBlur ellipseEffect = new GaussianBlur();
    ellipseEffect.setRadius(10);
    ellipse.setEffect(ellipseEffect);
    ellipse.setOpacity(0.1);
    ellipse.setClip(ellipseClip);
    background.getChildren().addAll(imageView, circle1, circle2, circle3, ellipse);
}
 
Example #21
Source File: GaussianBlurSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public static Node createIconContent() {

        Text sample = new Text("FX");
        sample.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD,80));
        sample.setStyle("-fx-font-size: 80px;");
        sample.setFill(Color.web("#333333"));
        final GaussianBlur GaussianBlur = new GaussianBlur();
        GaussianBlur.setRadius(15);
        sample.setEffect(GaussianBlur);
        return sample;
    }
 
Example #22
Source File: GaussianBlurSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public GaussianBlurSample() {
    super(48,48);
    ImageView sample = new ImageView(ICON_48);
    final GaussianBlur gaussianBlur = new GaussianBlur();
    gaussianBlur.setRadius(8d);
    sample.setEffect(gaussianBlur);
    getChildren().add(sample);
    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("GaussianBlur Level", gaussianBlur.radiusProperty(), 0d, 15d)
    );
    // END REMOVE ME
}
 
Example #23
Source File: StopWatchSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
private void configureBackground() {
    ImageView imageView = new ImageView();
    Image image = loadImage();
    imageView.setImage(image);

    Circle circle1 = new Circle();
    circle1.setCenterX(140);
    circle1.setCenterY(140);
    circle1.setRadius(120);
    circle1.setFill(Color.TRANSPARENT);
    circle1.setStroke(Color.web("#0A0A0A"));
    circle1.setStrokeWidth(0.3);

    Circle circle2 = new Circle();
    circle2.setCenterX(140);
    circle2.setCenterY(140);
    circle2.setRadius(118);
    circle2.setFill(Color.TRANSPARENT);
    circle2.setStroke(Color.web("#0A0A0A"));
    circle2.setStrokeWidth(0.3);

    Circle circle3 = new Circle();
    circle3.setCenterX(140);
    circle3.setCenterY(140);
    circle3.setRadius(140);
    circle3.setFill(Color.TRANSPARENT);
    circle3.setStroke(Color.web("#818a89"));
    circle3.setStrokeWidth(1);

    Ellipse ellipse = new Ellipse(140, 95, 180, 95);
    Circle ellipseClip = new Circle(140, 140, 140);
    ellipse.setFill(Color.web("#535450"));
    ellipse.setStrokeWidth(0);
    GaussianBlur ellipseEffect = new GaussianBlur();
    ellipseEffect.setRadius(10);
    ellipse.setEffect(ellipseEffect);
    ellipse.setOpacity(0.1);
    ellipse.setClip(ellipseClip);
    background.getChildren().addAll(imageView, circle1, circle2, circle3, ellipse);
}
 
Example #24
Source File: GaussianBlurSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public static Node createIconContent() {

        Text sample = new Text("FX");
        sample.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD,80));
        sample.setStyle("-fx-font-size: 80px;");
        sample.setFill(Color.web("#333333"));
        final GaussianBlur GaussianBlur = new GaussianBlur();
        GaussianBlur.setRadius(15);
        sample.setEffect(GaussianBlur);
        return sample;
    }
 
Example #25
Source File: GaussianBlurSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public GaussianBlurSample() {
    super(48,48);
    ImageView sample = new ImageView(ICON_48);
    final GaussianBlur gaussianBlur = new GaussianBlur();
    gaussianBlur.setRadius(8d);
    sample.setEffect(gaussianBlur);
    getChildren().add(sample);
    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("GaussianBlur Level", gaussianBlur.radiusProperty(), 0d, 15d)
    );
    // END REMOVE ME
}
 
Example #26
Source File: GuiUtils.java    From green_android with GNU General Public License v3.0 5 votes vote down vote up
public static void blurIn(Node node) {
    GaussianBlur blur = (GaussianBlur) node.getEffect();
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 0.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.setOnFinished(actionEvent -> node.setEffect(null));
    timeline.play();
}
 
Example #27
Source File: GuiUtils.java    From green_android with GNU General Public License v3.0 5 votes vote down vote up
public static void blurOut(Node node) {
    GaussianBlur blur = new GaussianBlur(0.0);
    node.setEffect(blur);
    Timeline timeline = new Timeline();
    KeyValue kv = new KeyValue(blur.radiusProperty(), 10.0);
    KeyFrame kf = new KeyFrame(Duration.millis(UI_ANIMATION_TIME_MSEC), kv);
    timeline.getKeyFrames().add(kf);
    timeline.play();
}
 
Example #28
Source File: BlurTransition.java    From TweetwallFX with MIT License 4 votes vote down vote up
public BlurTransition(
        final Duration duration,
        final GaussianBlur blur) {
    this(duration, blur,
            Double.NaN, Double.NaN);
}
 
Example #29
Source File: LoadingScreen.java    From FXTutorials with MIT License 4 votes vote down vote up
private Node makeSymbol() {
    Pane symbol = new Pane();

    GaussianBlur blur = new GaussianBlur(2.5);
    symbol.setEffect(blur);

    Rectangle top = new Rectangle(70, 5, Colors.LOADING_SYMBOL);
    top.setArcWidth(25);
    top.setArcHeight(25);

    Rectangle mid = new Rectangle(100, 5, Colors.LOADING_SYMBOL);
    mid.setArcWidth(25);
    mid.setArcHeight(25);

    Rectangle bot = new Rectangle(70, 5, Colors.LOADING_SYMBOL);
    bot.setArcWidth(25);
    bot.setArcHeight(25);

    top.setTranslateX(15);
    bot.setTranslateX(15);

    top.setTranslateY(10);
    mid.setTranslateY(10 + 10 + 5);
    bot.setTranslateY(10 + 10 + 5 + 10 + 5);

    Circle circle = new Circle(25, 25, 25, Color.BLACK);
    circle.setStroke(Colors.LOADING_SYMBOL);
    circle.setStrokeWidth(2);
    circle.setTranslateX(25);

    Circle circle2 = new Circle(25, 25, 25, Color.BLACK);
    circle2.setStroke(Colors.LOADING_SYMBOL);
    circle2.setStrokeWidth(1);
    circle2.setTranslateX(25);
    circle2.setRadius(2);

    Circle point = new Circle(25, 25, 25, Colors.LOADING_SYMBOL);
    point.setStroke(Colors.LOADING_SYMBOL);
    point.setStrokeWidth(1);
    point.setTranslateX(25);
    point.setRadius(1);

    KeyFrame frame = new KeyFrame(Duration.seconds(1),
            new KeyValue(circle2.radiusProperty(), 20));

    timeline.getKeyFrames().add(frame);
    timeline.setCycleCount(5);
    timeline.play();

    symbol.getChildren().addAll(top, mid, bot, circle, circle2, point);
    return symbol;
}
 
Example #30
Source File: PauseView.java    From CrazyAlpha with GNU General Public License v2.0 4 votes vote down vote up
public PauseView() {
    root = new Pane();
    Game.getInstance().resetMedia();

    map = Game.getInstance().getMapManager().getCurrentMap();
    mapIv = new ImageView(map.getMapImage());
    mapIv.setFitWidth(Game.getInstance().getWidth());
    mapIv.setFitHeight(Game.getInstance().getHeight());

    nameLbl = new Label("CrazyAlpha!");
    nameLbl.setTextFill(Color.WHITESMOKE);
    nameLbl.setFont(Game.getInstance().getResouceManager().getFont("Starcraft", 120));
    nameLbl.setLayoutX(50);
    nameLbl.setLayoutY(50);

    Reflection reflection1 = new Reflection();
    reflection1.setFraction(1.0);
    nameLbl.setEffect(reflection1);

    Reflection reflection02 = new Reflection();
    reflection02.setFraction(0.4);

    resumeBtn = new ImageView(Game.getInstance().getResouceManager().getControl("btn_resume"));
    resumeBtn.setFitWidth(165 * 1.5);
    resumeBtn.setFitHeight(65 * 1.5);
    exitBtn = new ImageView(Game.getInstance().getResouceManager().getControl("btn_exit"));
    exitBtn.setFitWidth(165 * 1.5);
    exitBtn.setFitHeight(65 * 1.5);

    resumeBtn.setLayoutX(map.getWidth() - resumeBtn.getFitWidth() - 20);
    resumeBtn.setLayoutY(map.getHeight() - resumeBtn.getFitHeight() - exitBtn.getFitHeight() - 120);
    resumeBtn.setEffect(reflection02);
    resumeBtn.setOnMouseEntered(event -> {
        resumeBtn.setEffect(new Glow(0.8));
        Game.getInstance().getButtonOverMusic().play();
    });
    resumeBtn.setOnMouseExited(event -> {
        resumeBtn.setEffect(reflection02);
        Game.getInstance().getButtonClickMusic().stop();
    });
    resumeBtn.setOnMousePressed(event -> {
        resumeBtn.setEffect(new GaussianBlur());
        Game.getInstance().getButtonClickMusic().play();
        Game.getInstance().resume();
    });
    resumeBtn.setOnMouseReleased(event -> {
        resumeBtn.setEffect(new Glow(0.8));
    });

    exitBtn.setLayoutX(map.getWidth() - exitBtn.getFitWidth() - 20);
    exitBtn.setLayoutY(map.getHeight() - exitBtn.getFitHeight() - 60);
    exitBtn.setEffect(reflection02);
    exitBtn.setOnMouseEntered(event -> {
        exitBtn.setEffect(new Glow(0.8));
        Game.getInstance().getButtonOverMusic().play();
    });
    exitBtn.setOnMouseExited(event -> {
        exitBtn.setEffect(reflection02);
        Game.getInstance().getButtonOverMusic().stop();
    });
    exitBtn.setOnMousePressed(event -> {
        exitBtn.setEffect(new GaussianBlur());
        Game.getInstance().getButtonClickMusic().play();
    });
    exitBtn.setOnMouseReleased(event -> {
        exitBtn.setEffect(new Glow(0.8));
        Game.getInstance().exit();
    });


    root.getChildren().add(mapIv);
    root.getChildren().add(nameLbl);
    root.getChildren().add(resumeBtn);
    root.getChildren().add(exitBtn);

    makeFadeTransition(resumeBtn, 2000, 1, 0.7);
    makeFadeTransition(exitBtn, 2000, 1, 0.7);
    makeFadeTransition(mapIv, 3000, 1, 0.8);
    makeScaleTransition(mapIv, 10000, 0.25, 0.25);
}