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.
- Empty GameObject
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
- Add Layout Content Size Filter to Text UI
- 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
3. Access content Text UI through script
Watch video for more