Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 15 ■ 3D Gameplay UI CreatIon: UsInG the sphere prImItIve to Create a UI noDe


the chain icon between the width and height, and set the height value to 512. This will stretch the color
bars to fill the image so that you don’t have to do a lot of select-move-fill work like you did originally to create
the beach ball texture map. This scaling operation will also make the text components taller, which will
make them more readable in the Sphere spinner UI, especially while it is spinning. Finally, right-click the #2
layers for S, P, I, and N and create layer #3 and layer #4 for each. Use the Move tool and the right arrow key to
precisely position them.


Finally, use File ➤ Export As to overwrite the current gameboardspin.png file in your Project /src/
folder. Since that file name is already being referenced within the diffuse25 Image object instantiation
statement, all that you have to do is to change the width and height values from 256 to 512 , which, when
mapped onto a Sphere primitive of the same size, will serve to decrease the size of both the stripes and the
text elements (letters) on the Sphere so that instead of two letters (SP, shown in Figure 15-14), four letters
(SPIN) will be shown. At that point, all that you have to do is to tweak the rotation value somewhere between
20 and 30 degrees so that the word SPIN will be centered in the Sphere object named spinner so that the user
knows what will happen when this Sphere spinner UI object is clicked.


Figure 15-15. Use a 256-pixel beach ball texture map to create a more detailed 512-pixel Sphere spinner UI
texture map

Free download pdf