Game Development Reference
In-Depth Information
To do this, we'll need to hide the ImageView Node objects that hold our full screen
(splashScreenbackplate) and overlay (splashScreenTextArea) image assets. We will do
this by setting the visible attribute (or characteristic, or parameter, if you prefer) to a
value of false , which will allow the white background color that we set to show
through.
Finishing the UI Design: Coding a Game
Play Button
The next thing that we will need to do is to finish the Button control event handling
code so that when we click on the GAME PLAY Button object, the white background
is revealed for us to develop our game over. Later on we can use the ImageView plates
that we use for our splash screen support to provide background image compositing for
the game to make it more interesting visually. The way that we are going to hide the
two ImageView Node objects in the Scene Graph is by calling the .setVisible() method
off of each of these objects inside of the .handle() method that is attached to the PLAY
GAME UI Button object. This can be seen in the bottom portion of Figure 9-2 , and
would be implemented using the following two lines of Java code, inside of the
.handle() EventHandler<ActionEvent> method structure:
splashScreenBackplate.setVisible( false );
splashScreenTextArea.setVisible( false );
 
Search WWH ::




Custom Search