
Unity 4.x Game Development by Example: Beginner's Guide
By :

Double-click on ClockScript. Your empty script, with the default the Start()
and Update()
functions and the #pragma strict
line, should appear in the code editor. The very first thing we should consider is doing away with our puce background by changing the GUIText color to black instead of white. Let's get at it:
Replace the Start
function with the built-in Awake
function and change the GUIText color:
function Awake() { guiText.color = Color.black; } function Update() { }
Save the script and test your game to see your new black text.
As we've seen before, Awake
is a built-in function just like Start
, but it happens even earlier. Awake
is the first function that gets called when our script runs.
If you feel comfy, you can change the game background color back to white by clicking on the Main Camera GameObject and finding the color swatch in the Inspector panel. The white whatever GUIText will disappear against the white background in the...
Change the font size
Change margin width
Change background colour