Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 22 ■ SCoring engine: Creating the SCore Ui LayoUt and SCoring the Content

Again, use the Run (^) ➤ Project work process and make sure your game SplashScreen and game
board spin are back to their “clean” appearance; then spin and select game board square 1 to invoke the
cameraAnimIn object .setOnFinished(event) event handling method logic, which is revealing both the
StackPane UI containers at this point.
This allows us to test the Score UI container code after the camera angles have changed. As you
can see in Figure 22-11, all we have to do is to move the StackPane down by 10 units by changing the
.setTranslateY() method call of -395 (shown in Figure 22-8) to a value of -385 to achieve a perfectly
mirrored Score UI panel result.
Figure 22-10. To show the scoreLayout StackPane, add a .setVisible(true) method call in cameraAnimIn.
setOnFinished()
Figure 22-11. Use Run ➤ Project to render the Score panel, via the .setOnFinished() event handler, showing
the initial pane position

Free download pdf