How to create scrollable dynamic text in Unity 5

In this tutorial, i will show you how to make scrolling content in unity and how to set content for scrollable textarea.

1. Creating UI elements.

- Panel
- Image
- Empty GameObject
- Text

Scrolling content in unity 1

2. Creating a srolling text content.

- Add UI Scroll Rect and Mask Component to Image UI.
The Scroll Rect is a rect that can be scrolled horizontally or vertically to create masked spaces with hidden content in your UI.
The Mask make the overflown text to be clipped right within the rectangle region of the ScrollView

Scrolling content in unity 2

- Add Layout Content Size Filter to Text UI

Scrolling content in unity 3

- Put Text UI as Content of Scroll Rect
Set a long string for the Text UI in the inspector and adjust the font size.
Drag Text UI to the "Content" of ScrollView

Scrolling content in unity 4

3. Access content Text UI through script

Watch video for more

related posts