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


Use the Run (^) ➤ Project work process in Figure 22-3 to see the fix to this problem in your SplashScreen.
Now that we have fixed that minor (code-wise) SplashScreen rendering issue, we can proceed to create
your Score UI layout design, starting with a scoreLayout StackPane object and the Text objects that contain
its decoration.
Scoreboard UI Design: A createScoreNodes() Method
Let’s have NetBeans create a createScoreNodes() custom method body for us by adding a line of code
after the qaLayout.setVisible(false); statement we just added and then using the Alt+Enter keystroke
combination to trigger this automated method coding by NetBeans 9. The Java statement for this is shown
here and highlighted in the middle of Figure 22-4:
public void start() {
loadImageAssets();
loadAudioAssets();
createSpecialEffects();
createTextAssets();
createMaterials();
createBoardGameNodes();
createUInodes();
createQAnodes();
qaLayout.setVisible(false);
createScoreNodes();
...
}
Figure 22-3. Your Q&A UI panel is now hidden on startup, in the top of your .start() method

Free download pdf