Game Development Reference
In-Depth Information
As you probably realize by now, we'll need to “counter” this move in the other
three Button event handling structures. We will use the opposite of the .toBack() meth-
od call, which is of course the .toFront() method call. As you can see, we need to not
only call the .toFront() method off of the splashScreenBackplate ImageView Node
object, but also off of the splashScreenTextArea ImageView object, and the but-
tonContainer HBox object that is holding our UI Button controls. We will need to call
this method off of all of these Splashscreen and UI objects so that all of these are
brought back to the front of the JavaFX Scene Graph Node Stack. The Java code,
shown in Figure 17-27 , looks like this:
helpButton .setOnAction((ActionEvent) -> {
splashScreenBackplate.setImage( splashScreen );
splashScreenBackplate.toFront();
splashScreenBackplate.setVisible( true );
splashScreenTextArea.setVisible( true );
splashScreenTextArea.setImage(instructionLayer);
splashScreenTextArea.toFront();
buttonContainer.toFront();
});
 
Search WWH ::




Custom Search