Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 9 ■ JavaFX 9 User InterFaCe DesIgn: the Front enD For Java 9 game DesIgn

helpText.setFont(Font.font("Helvetica", FontPosture.REGULAR, 50));
cardText = new Text("If you land on a square\nthat requires you draw a card, it
will\nappear in the floating UI text area.");
cardText.setFill(Color.GREEN);
cardText.setFont(Font.font("Helvetica", FontPosture.REGULAR, 50));
copyText = new Text("Copyright 2015 Wallace Jackson.\nAll Rights Reserved.\n");
copyText.setFill(Color.PURPLE);
copyText.setFont(Font.font("Helvetica", FontPosture.REGULAR, 50));
riteText = new Text("Visit the iTVboardGame.com website on\nthe Internet
at http://www.iTVboardgame.com");;)
riteText.setFill(Color.PURPLE);
riteText.setFont(Font.font("Helvetica", FontPosture.REGULAR, 50));
credText = new Text("Digital Imaging, 3D Modeling, 3D\nTexture Mapping
by Wallace Jackson.\n");
credText.setFill(Color.BLUE);
credText.setFont(Font.font("Helvetica", FontPosture.REGULAR, 50));
codeText = new Text("Game Design, User Interface Design,\nJava Programming
by Wallace Jackson.");
codeText.setFill(Color.BLUE);
codeText.setFont(Font.font("Helvetica", FontPosture.REGULAR, 50));
}


You have made a lot of progress toward putting together your professional Java game splash screen
design, user interface design, and top-level SceneGraph and class (and method) infrastructure during
this chapter. You have also learned about the Image, ImageView, Text, TextFlow, Background, and
BackgroundImage classes. Pat yourself on the back, if you are that flexible, and then take a little break from
Java 9 programming!


Figure 9-23. Finish configuring your Text objects using .setFill() and .setFont() methods with Color and
Helvetica values

Free download pdf