Game Development Reference
In-Depth Information
the three Parent (and leaf) Node objects to the Scene Graph root (in this case, the
StackPane object, which you are using for its multilayer UI object-compositing capab-
ility).
Next, you learned about some of the JavaFX classes for implementing these new
methods, including the Pos class and the Insets class, from the javafx.geometry pack-
age; the Image and the ImageView class, from the javafx.scene.image package; the
HBox class, from the javafx.scene.layout package; and the TableView class, from the
javafx.scene.control package. You coded the new .createSplashScreenNodes() meth-
od, which instantiated and configured the HBox object, using the Insets object, and
then the Image and ImageView objects and the four Button objects. Once all these
Scene Graph nodes were instantiated and configured, you wrote an .addNodesToStack-
Pane() method to add Node objects to the StackPane root object so that they would be
displayed by the Stage object, which references the Scene Graph's root object. Next,
you tested your top-level game application UI design. Then, you added in the last
couple of Image objects and added ActionEvent EventHandler program logic. Finally,
you profiled the application to make sure it was efficient.
In the next chapter, I will present the JavaFX pulse engine and the Anima-
tionTimer class so that you can create the infrastructure for your Java 8 game engine,
which will process your game events in real time.
Search WWH ::




Custom Search