Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • HUD (Head Up Display) in Unity

    • 0
    • 9
    • 1
    • 4
    • 4
    • 0
    • 0
    • 0
    • 713
    Comment on it

    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!");
            }
        }
    }
    

    alt text

    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");
        }
    }
    

    alt text

    With the help of these you can make any type of HUD. Be free to code...... :)

 4 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: