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 Exception in TextMeshPro

Discussion in 'UGUI & TextMesh Pro' started by dadude123, Feb 7, 2018.

  1. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    I have a normal TMP UGUI component and this text:

    And when entering play mode this happens:

    Happens multiple times every frame, the text doesn't appear then.

    Also when I edit in the nested link, it also won't work because TMP only recognizes one link (the inner most).
    Are nested links not supported? Can that be added?
    What are the alternatives to mark a span of text with some tag?

    TextMeshPro version: newest from asset store.
    Unity version: 2017.3.0f3
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Nested links are not support but I understand what you are trying to do so let me look into this.

    BTW: A new tag that I am planning on adding (at some point) is the <action="jitter" params="0, 1, 0"> </action> which will allow users to define the action and parameters. Then you will have an ActionSheet where you will associate with for instance this "jitter" action, one of your scripts that actually defines what this action does.

    See the following thread on the TMP user forum. http://digitalnativestudios.com/forum/index.php?topic=697.msg5976#msg5976

    P.S. I have no ETA on this yet as I have to prioritize the implementation of the new text system but I most certainly want to add that tag at some point as I think it would be pretty cool.
     
  3. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Hi,
    I wanted to ask if there's any workaround or progress for this, I'd be grateful for even a suggestion how this could be solved.

    Nested links, and also "unbalanced" links are really important for me.

    Is that "action" implementation on your radar in the foreseeable future? Or no ETA still?
    I just want to know if it'd be worth it to hack it in myself, or if it gets implemented by the time I'm done anyway.
     
  4. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    I found a neat way to solve this myself. I'm pre-processing the text by simply parsing the text into logical blocks (separated by opening or closing tags), then removing my custom tags from the text and adjusting the indices of the blocks I calculated. :)

    After that the text can be set and will be displayed as normal in TMPro, and you can even lookup what block any letter/word/line is in based on the index.

    If anyone else has this problem let me know and I'll post a class that provides methods to do all this.
     
    Stephan_B likes this.