- Home /
Question by
mechanicarts · Apr 11, 2013 at 09:20 AM ·
textpushgui.box
How to add extra text to GUI.Box?
I have 5 variables. For each one, the script checks their status and must add more text to a GUIBox. How to do that?
Comment
Answer by fafase · Apr 11, 2013 at 09:30 AM
Well, turn them into string and add them together to create a large string:
int a = scriptA.member;
int b = scriptB.member;
int c = scriptC.member;
int d = scriptD.member;
int e = scriptE.member;
string str = a.ToString()+" "+b.ToString()+" "+c.ToString()+ " " + d.ToString()+" "+ e.ToString();
void OnGUI(){
GUI.Box(rect,str);
}
Your answer
Follow this Question
Related Questions
Displaying GUI.box in VR Headset in Scene 0 Answers
Change GUI Style color with JavaScript 1 Answer
Why my text is invisible? 1 Answer
Canvas UI Priority layers 1 Answer
VS is not suggesting FixedUpdate and text will not change color. Why? 1 Answer