|
function OnGUI () { // Make a background box GUI.Box (Rect (10,10,100,90), "Hello"); } The above works. But I want to do the following, with a real variable of course... function OnGUI () { var x : float; x = 22.2; GUI.Box (Rect (10,10,100,90), x); } the above fails compile. all the code samples I see just output a string. what is the syntax if I want to output a variable?
(comments are locked)
|
|
The GUI functions expect a string or GUIContent to draw (rather than a float). In your case, the simplest thing would be to just use ToString(). e.g.
(comments are locked)
|
|
thxs for the answer!!!
(comments are locked)
|
