- Home /
GUI text Issues
Im trying to make the text in the code below so when it shows it game i can place lines inbetween it with no text such as like this.
Room 1001
Set one cost bla bla bla
Set two cost bla bal bal
I want the line spaces in between my text to help space it out. Here is my code:
function OnGUI() { GUI.TextArea(Rect (150,150,500,350),"Room 100" ); }
And does it have line breaks already?
If it does just do yourText.Replace("\\n","\\n\\n");
why does writing \n for you work! it keeps removing the \ when I post :(
@Scribe :) I typed \\\\n You can indent four characters for code and it works too :)
And of course to do that I typed \\\\\\\\n - oh dear this could be a long night...
Answer by Scribe · May 29, 2012 at 08:41 PM
I tried to write in the comments but it refused to display the \ when I posted my answer.
\n will create a new line I believe, so doing
function OnGUI() {
GUI.TextArea(Rect (150,150,500,350),"Room 100\n\nSet one cost..." );
}
should hopefully work,
Scribe
Your answer
![](https://koobas.hobune.stream/wayback/20220613072116im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Wierd GUI problem 1 Answer
Networkmanager errors and gui to small 0 Answers
Choose which GUItext to display 1 Answer
Gui rotation? 2 Answers
Resizable GUI box how to? 1 Answer