Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 21 ■ Questions and answers: Finishing the setup Methods and digital audio

Move the Z position of the qaLayout StackPane object by -75 units toward the front of the screen using
the following setTranslateZ() Java method call, which is highlighted in light blue and yellow in Figure 21-8:


qaLayout.setTranslateZ(-75);


Again, use the Run ➤ Project work process and test this new Java code by moving the z-axis forward
to see whether it gives you the desired result. As you can see in Figure 21-9, the StackPane is now rendering
correctly as a white square.


Figure 21-8. Add a setTranslateZ(-75) method call off the qaLayout object to move it 75 units toward the front
screen


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

Free download pdf