Game Development Reference
In-Depth Information
Figure
17-3 .
Add
a
private
Font
scoreFont
declaration
and
use
Alt-Enter
and
select
“Add
import
javafx.scene.text.Font”
Before we can use this scoreFont Font object to style the scoreText Text object, we
will need to add this scoreText Text Node object to the JavaFX Scene Graph by using
the root.getChildren().add(scoreText); Java statement, which is shown
highlighted in Figure 17-4 . If you forget to do this, you will see only white on your
game screen after you click the PLAY GAME Button!
 
 
 
Search WWH ::




Custom Search