Long text in GUI

I have a little problem with GUI system in my game. In dialog windows text is apearing randomly from script that contains texts but sometimes text is longer than space for it. I cant make any longer label and I am wondering is it any way to automatically send text to next line like with \n. I dont want to put \n in every text bcos in other resolutions this will still be a problem.

With any UnityGUI drawing command (for instance GUI.TextField) you could use the one of the overloads having the GUIStyle passed in.

In your style you should then set the wordWrap to true.

Your text doesn’t need to have newlines (“\n”) to wrap.

You could see the effect when resizing windows in this WebPlayer demo (load the 3rd sub-demo using the Load next demo button at bottom right).

1154264--43971--$wordWrap.png