Game Development Reference
In-Depth Information
Figure 6-9 . Run the InvinciBagel application, and make sure that the StackPane compositing class is working cor-
rectly
Because you only copied and pasted the EventHandler routines for each button, and
changed your Button objects' names but not the code inside these routines, the Button
objects will still work properly (writing text to the console) and not cause compiler er-
rors. However, they will not do what you want them to do, which is to change an image
overlay so that the panel on the left-hand side of the design holds a title and text that
you want it to show a user.
This will be done using a call to the .setImage() method, which will set the
splashScreenTextArea ImageView object to the instructionLayer, scoresLayer, or leg-
alLayer Image object, based on which Button UI control is clicked by the user. You
cannot implement this event-handling code until you add the last two Image object in-
stantiations!
Finishing an InvinciBagel UI Screen
Design: Add Images
Let's finish with the createSplashScreenNodes() method by adding two more lines at
the end of the method that add two more Image objects, referencing the invincibagel-
creds.png and invincibagelscores.png 32-bit PNG32 digital image assets. This is done
 
Search WWH ::




Custom Search