Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[noob] How to make a label with a var...

Discussion in 'Immediate Mode GUI (IMGUI)' started by Rond, Dec 1, 2009.

  1. Rond

    Rond

    Joined:
    Oct 21, 2009
    Posts:
    175
    I'm new at this, so anyone?
    i've tried the documentation but i didn't find nothing about it !
    some help..?

    ps: sorry about the bad english.
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Do you mean you want to make the value of a variable visible in a label? For most simple types, you can use the ToString method to convert the value to a string:-
    Code (csharp):
    1. var x: float = 2.75;
    2. GUI.Label(someRect, x.ToString());