- Home /
hot to make the text wrap and space
I have alreay make a "Label" and input many text from "xml".can any body tell me how to make the text wrap and space.
Answer by denewbie · Nov 20, 2010 at 08:21 AM
Create a GUISkin and under the "label" section set what ever you like.
Attach the Skin to your script and then use it.
The code should look something like this:
var myGUIStyle: GUISkin;
function OnGUI(){
GUI.Label( Rect(0,0, 200, 20), "My Content", myGUIStyle.label); }
I m not too sure about wrapping but with this you could control the alignment, color and other stuff. The text should be automatically wrapped if your label is big enough.
You can set wordWrap in the label style as well. (Note that a GUISkin contains multiple GUIStyles, so "myGUIStyle" should really be called "myGUISkin".)
Your answer
![](https://koobas.hobune.stream/wayback/20220613083745im_/https://answers.unity.com/themes/thub/images/avi.jpg)