I have a (still unfinished) script that shows text when you enter a trigger, but right now it’s just white text in the Arial font.
How do I change the color and the font to one of the fonts I imported. (And is it possible to add a shadow or outline to the text?)
var buttonInRange;
var buttonActivated;
var amount : float = 0;
var CamTimer : CamTimer;
private var hasPlayed = false;
function OnTriggerEnter (c : Collider)
{
buttonInRange = true;
}
function OnTriggerExit (c : Collider)
{
buttonInRange = false;
}
function OnGUI ()
{
if(buttonInRange == true)
{
GUI.Label (Rect (Screen.width/2-50, Screen.height/2-55, 120, 50), "Pick up battery");
if (buttonInRange == true)
{
if (Input.GetKeyDown ("e"))
{
GUI.Label(Rect(155, 100, 75, 23), "Batteries: " + amount.ToString("1"));
}
}
}
}
function Update ()
{
if (buttonInRange == true)
{
if (Input.GetKeyDown ("e"))
{
Destroy(gameObject);
hasPlayed = true;
}
}
}