UnityGUI multi line label

Is there a way to make a multi lined label in UnityGUI? Or disable user input to the TextArea.

Also does the inspector format strings in some odd way?

I have tried writing: Line one\nThis is line two in the inspector, but it just puts out the string as it is written in the inspector not interpreting the \n as a new line for the textarea gui element as written in the api example.

I often use the Box style for non-editable GUI stuff.
But it shouldn’t make a difference, your GUI label should work over multiple lines - if not, it could be something in the GUISkin setting for labels.
Try setting the text via script and see if that fixes the problem that you’re getting when using the inspector.

Cheers
Shaun

GUI.Label(new Rect(0,20,100,100), "test\ntest2");

The above code does do multi lined labels as expected.

If pasting the text string “test\ntest2” with the "'s removed or not to the inspector string variable defined by

string description;

And using this line to draw the label:

GUI.Label(new Rect(0,20,100,100), description);

Does not yield the same result. why?

Edit: Am using the default gui skin included in unity.

\n in the inspector is interpreted as backslash character, followed by ‘n’. You need to copy/paste in a line that has the newline in there. To enter one from the keyboard, use ALT-return

Thanks Nicholas!