x


guiText.text could this be word wrapping?

I do not know how to wrap this codes for the GUIText could any one please show me how? This code make my text typing from left to right but I need it wrapped so I could write more words for my game so please show me how? This code original from wiki.

/////////////////////////////////////////////////////////////////////////////////

var letterPause = 0.2; var sound : AudioClip;

private var word;

function Start() { word = guiText.text; guiText.text = "" ; TypeText (); }

function TypeText () { for (var letter in word.ToCharArray()) {

    guiText.text += letter;
    if (sound)
        AudioSource.PlayClipAtPoint(sound, Camera.main.transform.position, .66);
    yield WaitForSeconds (letterPause);
}       

}

more ▼

asked Dec 02 '10 at 05:54 PM

BSVALVE gravatar image

BSVALVE
1 18 20 25

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Word Wrap is a property of GUI Style, read up on how to implement GUI Styles here

http://unity3d.com/support/documentation/Components/class-GUIStyle.html

more ▼

answered Dec 02 '10 at 06:36 PM

Rennat gravatar image

Rennat
664 5 8 18

(comments are locked)
10|3000 characters needed characters left

Thanks for this notice.

more ▼

answered Dec 03 '10 at 06:45 AM

BSVALVE gravatar image

BSVALVE
1 18 20 25

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x313
x21
x8

asked: Dec 02 '10 at 05:54 PM

Seen: 1970 times

Last Updated: Dec 02 '10 at 05:54 PM