Game Development Reference
In-Depth Information
by employing the following two lines of Java object instantiation code using the new
keyword:
legalLayer = new Image( "/invincibagelcreds.png", 640,
400, true, false, true );
scoresLayer = new Image( "/invincibagelscores.png", 640,
400, true, false, true );
As Figure 6-10 shows, the code is error free, because you have copied the four
PNG files into your project's /src folder. You do not need the other lines of code
(ImageView object instantiation, .setImage()), because you will be using the
splashScreenTextArea ImageView object to hold these last two Image objects. Thus,
you are saving on Scene Graph Node objects used, as you are using a single
ImageView Scene Graph Node object to display three different Image objects (over-
lays), based on button events.
Figure 6-10 . Adding legalLayer and scoresLayer Image object instantiations to add the other image composite plates
This means that the splashScreenTextArea.setImage() method calls you will
make off the splashScreenTextArea ImageView object will be placed inside the Ac-
tionEvent EventHandler programming constructs for the three Button objects that trig-
ger image composite overlays when they are clicked. The fourth Button object will
start up game play, so, for now, you will just have a Java comment in that button event-
handling structure, making it an “empty” logic structure. Now, let's take a look at how
to finish coding these EventHandler constructs so that you can finish this UI design and
get on with creating the game play engines mentioned earlier.
 
 
Search WWH ::




Custom Search