Home > other >  [Unity3D for help] automatic scrolling function similar to a chat
[Unity3D for help] automatic scrolling function similar to a chat

Time:09-24

Now in order to realize the function: the dynamically generated text
Automatic arrangement of text

temporary unrealized function, for help: the chat box automatically aligned to the latest generation of the last line of text
And chat box (Content) size can automatically increases to accommodate all child parts (words)


Below are the relevant code and ideas, figure:
 
Public Transform Text;
GameObject prefab.

Void aaaaaa () {
Prefab=Instantiate (textPrefab) as GameObject;
Prefab. GetComponent & lt; The Text & gt; (a). The text="you came to the outskirts road!" ;
Prefab. Transform. SetParent (Text);
}

CodePudding user response:

Why can't upload pictures?
Note: the Text prefab textPrefab is already set good,
And a chat TEXT has increased Vertical Layout Group components,

  • Related