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

The Java code, shown at the bottom of Figure 22-27, should look like the following code:

rightAnswers = new Text("0"); // Initializes rightAnswers to Zero
rightAnswers.setFont(Font.font("Arial Black", 64));
rightAnswers.setFill(Color.BLACK);
rightAnswers.setTranslateX( 96 );
rightAnswers.setTranslateY(160);


Figure 22-27. Add the rightAnswers Text object to createScoreNodes() to display the result of your integer
calculation

Free download pdf