I have a tooltip system and to avoid text spilling off the side of its backdrop, I need to occasionally insert line breaks. Since each object that has a tooltip has a tooltip script attached, it also has a public string where I can change what that tooltip is.
I’m using a stylistic 3D interface, so I’m using 3D text; thus there is no automatic word wrap or anything of the sort.
I tried inserting the standard
for a line break but it appears that this doesn’t work for text entered in the inspector. Does this mean I’m going to have to write an entire script just to implement line breaks? Seems a bit convoluted, so I figured I’d ask around for alternatives.
Add the TextAreaAttribute to your string variable, and the Inspector will now provide you with a larger text entry box that allows you to just use the Enter key to make carriage returns. Yay!
Guess I’ll just answer my own question since I figured out a workaround. Not a very convenient one, though. Looks like you have to type your line breaks out in Notepad and copy/paste them into the inspector. Only way to get it to work.
In the Inspector, first make sure the “LEADING” attribute in the TEXT AREA(SCRIPT)> PARAGRAPH> LEADING is set to “1.” Then, in the TEXT AREA(SCRIPT)> PLAIN TEXT, type your string out and press “Enter” anywhere you want a line break.
I don’t want to take credit for the answer above. A gentleman by the name of Ben O found this answer.
If your string is getting cut off, in the inspector > Text Area(Script) > Container > editing the Content Height or Content Width will give you more room to display your string.