Game Development Reference
In-Depth Information
scoreText
.setLayoutY
(365);
scoreText
.setLayoutX
(565);
Figure 17-2
.
Instantiate a scoreText object using a Java new keyword and call the .setText() and .setLayout() methods
For now, we are going to use the X,Y position value of
365,565
, as you can see in
Figure 17-2
.
To be able to style this Text object, we will need to declare a
private Font
object, named
scoreFont
, as seen in
Figure 17-3
. Use the
Alt-Enter
work process
again on the red error highlight, and select the “Add import for javafx.scene.text.Font”
option.