Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro Control word-wrap or truncate, per- line/paragraph/page

Discussion in 'UGUI & TextMesh Pro' started by jamesf42, Nov 25, 2023.

  1. jamesf42

    jamesf42

    Joined:
    Mar 10, 2023
    Posts:
    10
    What I have right now is a single TMP text control that is an in-game tooltip, with a lot of text in it with complex inner formatting using rich text tags. The issue is, I really want certain lines to be truncated if they do not fit the tooltip width, not word-wrapped (but all other parts excluding these lines, to be word wrapped).

    Example:
    Breaking this apart into multiple tmp text controls in my code is something i'd really really like to avoid here, but i don't know if there is any other option. In particular I would really not enjoy having to solve the problem of properly laying them out and dynamically adding the right number of them.

    Is this a situation others have found a way to deal with?

    Maybe there is a way to perform truncation myself? But the problem there is, it would need to actually parse and understand all the tags (they are everywhere, and i am often adjusting the size and line-height too).
     
  2. jamesf42

    jamesf42

    Joined:
    Mar 10, 2023
    Posts:
    10
    Anyone with any feedback/help on this topic would be Greatly appreciated.
     
  3. jamesf42

    jamesf42

    Joined:
    Mar 10, 2023
    Posts:
    10