Game Development Reference
In-Depth Information
1.
Save the script, and drag it onto the Game Manager object in the Hierarchy
view.
2.
Click Play.
The text appears at the top left corner of the Game view (Figure 10-1 ).
Figure 10-1. The Unity GUI Label element at runtime
The text is drawn on screen at the upper left of the viewport, telling you that 0,0 is the top left corner
of the screen. The text starts at the far left of the rectangle you specified to start at 0 x, 0 y, with a
width of 1000 and a height of 100. Let's see what happens with a full-screen view.
3.
Toggle on “Maximize on Play,” and click Play again.
The text remains the same size as before and is now dwarfed by the battery sprites (Figure 10-2 ).
Figure 10-2. The Unity GUI Label element in the maximized Game window at runtime
 
Search WWH ::




Custom Search