shrinkItem.setToX(0.0);
shrinkItem.setToY(0.0);
transitions.add(shrinkItem);
}
// Add fade out transition to every node
FadeTransition fadeOutItem = new FadeTransition(Duration.millis(300), node);
fadeOutItem.setToValue(0.0);
transitions.add(fadeOutItem);
}
// Add rotate and fade transition to main menu button
if (options.isButtonHideOnSelect()) {
RotateTransition rotateMainButton = new RotateTransition(Duration.millis(300), mainMenuButton);
rotateMainButton.setToAngle(225);
transitions.add(rotateMainButton);
FadeTransition fadeOutMainButton = new FadeTransition(Duration.millis(300), mainMenuButton);
fadeOutMainButton.setToValue(0.0);
transitions.add(fadeOutMainButton);
ScaleTransition shrinkMainButton = new ScaleTransition(Duration.millis(300), mainMenuButton);
shrinkMainButton.setToX(0.0);
shrinkMainButton.setToY(0.0);
transitions.add(shrinkMainButton);
} else {
RotateTransition rotateBackMainButton = new RotateTransition();
rotateBackMainButton.setNode(cross);
rotateBackMainButton.setToAngle(0);
rotateBackMainButton.setDuration(Duration.millis(200));
rotateBackMainButton.setInterpolator(Interpolator.EASE_BOTH);
transitions.add(rotateBackMainButton);
FadeTransition mainButtonFadeOut = new FadeTransition();
mainButtonFadeOut.setNode(mainMenuButton);
mainButtonFadeOut.setDuration(Duration.millis(100));
mainButtonFadeOut.setToValue(options.getButtonAlpha());
transitions.add(mainButtonFadeOut);
}
// Play all transitions in parallel
ParallelTransition selectTransition = new ParallelTransition();