Search Unity

TextMesh Pro Tags for requiring something to be on the same line?

Discussion in 'UGUI & TextMesh Pro' started by TSabos, Feb 28, 2019.

  1. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    94
    We have a requirement where we need to capture a set of text which would be impossible to regex and includes inline images using TMP sprite assets and need to ensure that the text is always on the same line.

    Is there any API or ways to detect this?

    Thanks.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    No sure I understand what you mean?

    Are you talking about disabling word wrapping?

    Please provide addition insight on the use case.
     
  3. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    94
    Like the trade info at the end here. I would like to know if all or nothing would fit on one line and if not, move to the next line. Everything between ()

     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Have you tried using the <nobr> tag and enclose your trade info in it? <nobr>trade info</nobr>
     
    TSabos likes this.
  5. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    94
    Wow sorry I can't believe I didn't find that.. works.. perfect. TMP is amazing ;)
     
    Stephan_B likes this.