Building a "2nd page" for a wall of text

Followup to this question: https://discussions.unity.com/t/934977/2

Hi. I built a UI element to act as a detail screen for enemies.

9512290--1340710--upload_2023-12-5_14-58-21.png

In some cases, the details are too long and I would need a 2nd page.

The way I want to implement this 2nd page is to have the string holding the details count how many characters there are, which makes the decision on if a 2nd page is needed, and what goes on the 2nd page. I intend to build the 2nd page with a button that changes the text without changing the canvas.

Is this the best way to implement this? Please let me know if more information is required.

There is a way you can link two separate text components so that the overflow from one ends up on the other. See the Overflow section here where you can set it to Linked so it overflows onto another text box.
https://docs.unity3d.com/Packages/com.unity.textmeshpro@3.2/manual/TMPObjectUIText.html#wrapping-and-overflow
If you want to do something more custom you might just have to write some kind of custom component yourself that does exactly what you need.

1 Like