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

TextMesh Pro Textmeshpro: "rich Text" Vs "allow Rich Text Editing"?

Discussion in 'UGUI & TextMesh Pro' started by MrLucid72, Apr 14, 2019.

  1. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    962


    What is the difference between these two? I couldn't find a doc link, especially about the 2nd "Allow Rich Text Editing" opt.

    Let's say, for example, I want rich text to work programatically but I don't want the user to input their OWN rich text: Where backspace would delete the WORD and not reveal the tag. What options should I use?
     
    ina likes this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Rich Text disables all input of Rich Text where typing something like <b> would result in the text in the input field showing <b>.

    Allow Rich Text Editing allows rich text to be typed and contained in the text but not the removal of hidden rich text.

    Example: A user could type "A <b>simple</b> example." where the word simple would be bold. The cursor could be placed before the letter e of example and then using backspace, would end up deleting the word simple but the bold tags would remain.

    When Allow Rich Text Editing is enabled, moving the cursor left to right, will result in the cursor stepping through the rich text hidden in the text. This would make the cursor appear to get stuck on some characters as it is stepping through the rich text underneath.
     
  3. G4M5T3R

    G4M5T3R

    Joined:
    Jan 10, 2015
    Posts:
    10
    Is there a way to unhide the rich text for editing already built into TMP or do I need to make my own solution? Like wrapping the input in <noparse> tags when a hypothetical "Edit" button is pressed for example.
     
  4. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,080
    I'm curious if a Unity mobile runtime richtext text editor asset has been made yet