Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TMP Loading LOTs of text into a Rect - with events.

Discussion in 'UGUI & TextMesh Pro' started by Cinqed, Jun 6, 2019.

  1. Cinqed

    Cinqed

    Joined:
    May 30, 2017
    Posts:
    20
    Hi,
    Basically, I'm after a scrollable "plain text vie"w with UX events for each word.

    I need to be able to load text files and render them in a scrollable rect. I see that there are UX events possible per character and or word so I imagine I want to "for each" on the words I'm importing, wire up the word, then add it to rect/canvas?

    Are there examples of this kind of approach for TMP? Is there API documentation I could find?

    Thanks,
    Dave G
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Separating / adding an object with RectTransform per word would be very inefficient.

    I suggest you take a look at example 12 and 12a included in the TMP Examples & Extras. These will show how you can hook up interactions per character or words. Then you will just need to deal with the scrolling view / etc.