- Home /
Dynamic text problem
Hi
I'm trying to write text (set number of words) on the screen one letter at a time, I was wondering whether this could be done using GUIText or would GUILabel be more appropriate?
I'm new to Javascript and Unity 3D and I was wondering whether anyone could point me in the right direction?
Any assistance would be greatly appreciated.
Answer by tertle · Feb 16, 2011 at 05:07 AM
I'd write you a basic script but I'm at work and sure to get it wrong.
Pretty much I'd just have 2 strings and an index. 1 string the final text you want on screen, the other what is current displayed on screen.
Then have a coroutine every X seconds take the letter at the index from the final text and add it to the end of the "display text string", and increment index.
Then just inside a OnGui call make GUI.Label display the "display text string".
Hope that makes some sense or points you kind of in right direction.
Thanks tertle I did something similar myself with a GUI Label - my problem was in my own logic in how I set up the timer, once that was solved it was easy.
Your answer
Follow this Question
Related Questions
Unity 4.1.2 Dynamic text disappears 0 Answers
novice: dynamically load xml or text and populate textfield (quiz style game) 1 Answer
2D GUI Curved Dynamic Text - possible? 1 Answer
clearing dynamic font texture on font size change 0 Answers
How to change text on a TextMesh with a non-dynamic font on iOS? 2 Answers