Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

increase size with Rect?

Discussion in 'Scripting' started by fredr92, Apr 27, 2014.

  1. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    function OnGUI(){
    GUI.Box(Rect(10,Screen.height-20,100,30),"Health: "+Mathf.Round(playerHealth.health));
    }


    i try to change the size off my Health display but it only change posision i want it too be 3 times larger.. Am i doing something wrong?

    Thanks for any help !
     
  2. Suddan

    Suddan

    Joined:
    Jan 12, 2013
    Posts:
    21

    The third and fourth parameter have to be altered if you want to change the size. The third paramter of the Rect-constructor is the width, the fourth is the height.
     
  3. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    The GUI Box is increasing but what inside the Box is not getting bigger "Health 100"