Help Translate void OnGUI() to GuiText

Hello,
because of the Performance Problems with OnGUI on the iPhone i try to display my Messages with GuiText. The Code is in C# and i found no example how to call GuiText from a C# that way or it doesn’t work. So here is what i want to translate or display with GuiText. I would be very happy if someone could give a simple example so that i can figure it out by myself…
many many thxxx

void OnGUI() {
		if (guiskin != null) GUI.skin = guiskin;
		if (!started) {
			GUILayout.BeginArea(new Rect(Screen.width -128 - 16, 16, 128, 128), "Round " + (round + 1), GUI.skin.window);
		float t = Time.time;
		GUILayout.Label("Total time: " + FmtTime(t - startTime));
		GUILayout.Label("Round time: " + FmtTime(t - passTime));
		if (roundTime > 0f) {
			GUILayout.Label("Last round: " + FmtTime(roundTime));
		}
		if (bestTime > 0f) {
			GUILayout.Label("Best round: " + FmtTime(bestTime));
		}
		GUILayout.EndArea();		
	}

Hi fellow’s…
after 130 Post reading later i found this…

public GUIText GT;

void Update () { 
			 float t = Time.time;
			    GT.text = ("Total time: " + FmtTime(t - startTime));
	}
	}

work’s well !

Now i have this Question… found no post about…
Is it possible to use more than one Line in GuiText ?
If i try this i got a error:

void Update () { 
			 float t = Time.time;
			    GT.text = ("Total time: " + FmtTime(t - startTime));
("Round time: " + FmtTime(t - passTime));
	}

Is there a Way to get 2 or 4 Lines ?
many thxxxx
Stefan

Use “\n” for a newline.

–Eric

:stuck_out_tongue: \n did the trick !!! Many thxxx Eric

does anyone know where to find more info about “\n” ToString(“f0”)

i only found some stuff here in the forums.
thxx
Stefan

ToString formatting is .net; “\n” is, well, universal. :slight_smile: Although I guess you should use System.Environment.NewLine instead…not sure it really matters in Unity though.

–Eric