HUD (Head Up Display)
A head-up display or heads-up displayalso known as a HUDis any transparent display that presents data without requiring users to look away from their usual viewpoints. The origin of the name stems from a pilot being able to view information with the head positioned "up" and looking forward, instead of angled down looking at lower instruments.
Unity provides best features to make the HUD.
http://docs.unity3d.com/Documentation/Components/GUIScriptingGuide.html
UnityGUI allows you to create a wide variety of highly functional GUIs very quickly and easily.
Rather than creating a GUI object, manually positioning it, and then writing a script that handles its functionality,
you can do everything at once with just a few lines of code. The code produces GUI controls that are instantiated, positioned and handled with a single function call.
For example, the following code will create and handle a button with no additional work in the editor or elsewhere:-
// JavaScript
function OnGUI () {
if (GUI.Button (Rect (10,10,150,100), "I am a button")) {
Debug.Log("You clicked the button!");
}
}
// C#
using UnityEngine;
using System.Collections;
public class GUITest : MonoBehaviour {
void OnGUI () {
if (GUI.Button (new Rect (10,10,150,100), "I am a button")) {
Debug.Log ("You clicked the button!");
}
}
}
For example, the following code will create a label with no additional work in the editor or elsewhere:-
// JavaScript
function OnGUI () {
GUI.Label (Rect (10,10,150,100), "I am a Label");
}
// C#
using UnityEngine;
using System.Collections;
public class GUITest : MonoBehaviour {
void OnGUI () {
GUI.Label (new Rect (10,10,150,100), "I am a Label");
}
}
With the help of these you can make any type of HUD. Be free to code...... :)
4 Comment(s)