Game Development Reference
In-Depth Information
Step 18. Unlike the previous GUIs we've used before, this one includes
a variable called myStyle. This will allow you to set font, size, colors,
backgrounds, and more for a GUI element. After modifying finish.js, select
the finish line object in the Hierarchy and look for the finish script in the
Inspector. As shown in Figure 4.15 , once a script uses the GUIStyle on an
object (such as the score label in finish.js ), the Inspector allows you to set
a whole lot of properties relating to the GUI. In this case, the previously
added font, its color, and alignment have been changed. Change these in
your game and press play to see the GUI come up on the screen.
Fig 4.15 GUIStyle properties.
For Rsearch
Unity GUI System
The entire Unity GUI system is explained in the manual at http://unity3d
.com/support/documentation/Components/GUI%20Scripting%20Guide
.html .
Step 19. To print out the score and the time since the game started,
modify finish.js to reflect Listing 4.24 .
Search Nedrilad ::




Custom Search