Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 17 ■ i3D Game Square SeleCtion: uSinG the piCkreSult ClaSS with 3D moDelS

To make the spinner UI animate onto the screen, we first have to set its initial position off-screen to the
left of its current starting position. Go into createBoardGameNodes() and change the TranslateX property
from -200 to -350. This will remove the spinner from view, just off of the left side of your screen. Later we will
change the .setByX() method in moveSpinnerIn to a setting of 150 so it lands at -200. This is done using the
Java code shown here and in Figure 17-5:


spinner.setTranslateX(-350);


Figure 17-4. Evaluate the picked Node object using two nested if{} constructs, testing for null and then for the
spinner UI Node


Figure 17-5. Prepare for implementing the interactive spinner UI by setting its initial position off-screen value
to the -350 X location

Free download pdf