Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 9 ■ JavaFX 9 User InterFaCe DesIgn: the Front enD For Java 9 game DesIgn

Open the createBoardGameNodes() method, and after your infoOverlay object instantiation, add a
line of code and call the .setTranslate X() method with a value of 240 off of the infoOverlay object. Then
add another line of code and call the .setTranslateY() method with a value of 420. This will position the
TextFlow container underneath the ImageView object (currently a welcome message) so that your block of
composited text will be at the bottom of the screen. The Java code for these statements should look like the
following (and are shown highlighted in Figure 9-15):


infoOverlay.setTranslateX( 240 );
infoOverlay.setTranslateY( 420 );


Figure 9-14. Add .setFill() and .setFont() methods to your SplashScreen text

Free download pdf