Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 21 ■ Questions and answers: Finishing the setup Methods and digital audio


Let’s use the Run ➤ Project work process and see how well we have guessed at what the basic 2D
StackPane configuration parameters should be for our left-side Q&A panel for the game. As you will see in
Figure 21-7, the Java code is working, but there are a couple of problems with some translucency in your
StackPane background color and an intersection with the game board because of the (unspecified) position
in the Z dimension. Also, we are laying this out at the pre-zoom-in camera settings, so once we fix this Z
positioning problem, we might also need to adjust some or all of the location and size settings that we are
putting into place initially (before going that deep into the gameplay code for our Q&A UI testing purposes).
This will allow us to generate Java code quickly and tweak it for looks later.


Figure 21-7. Use your Run ➤ Project work process and test your new Java code to see whether it gives you the
desired results


Figure 21-6. Add the qaLayout StackPane object to the root.getChildren.addAll() method call list in the
second position

Free download pdf