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


the start method so that your application can load these assets into system memory first thing so they are
there when the rest of your pro Java game code needs them and so that we do not have to use any specialized
preloader. Also, these objects must be in place before they can be called by other methods, so they need
to be called first, before the methods that set up more advanced objects and add them to the SceneGraph
hierarchy. Later, we can make sure this asset loading is taking less than a second using the NetBeans 9
profiler, once we have things like 3D object rendering and game processing logic that we need to make
sure is highly optimized and not taking up too many of the Pulse engine’s 60 FPS interrupts (time slices)
processing the SceneGraph.


Before we can continue, we need to create some new media assets to use with the Image objects, which
we are going to instantiate and reference (load) with PNG32 digital image assets, which will leverage alpha
channels. This alpha channel data will allow us to composite these logos or screen captions on top of any
background image or even over the i3D gameBoard itself if we choose to down the line. In the next section,
I will create an iTVBoardGame logo in Autodesk 3D Studio Max and then export it as an OBJ file and render
it using a cool (or maybe, hot) rock texture. Then we will have a pro Java 9 game 3D splash screen title for use
later on during the chapter as you refine your UI design.


Creating SplashScreen Assets: Using 3D Assets in a 2D Pipeline


As you can see in Figure 9-5, I have created a “quick and dirty” iTVBoardGame 3D logo using the 2D Text
tool and then extruding it, using the Bevel modifier, as you can see in the Autodesk 3D Studio Max version
of the Scene Graph hierarchy (called a Modifier List in 3D Studio Max) on the top-right portion of the
screenshot. I later used the File ➤ Export function to output a WaveFront .OBJ 3D file format, which is
one of the several 3D file import formats supported by JavaFX 9. We may be using this format, or one of the
others, depending on what types of 3D data we need to import, as each format supports different types of 3D
data and features, such as texture maps, UVW maps, inverse kinematic (IK) skeletal animation data, mesh


Figure 9-4. Create empty methods for loadImageAssets() and createTextAssets() to create your image and text
assets

Free download pdf