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 Utilize Link tag

Discussion in 'UGUI & TextMesh Pro' started by Daegit, Jan 6, 2020.

  1. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
    Hello,

    I im using TextMeshProGui for card descriptions and sometimes a description contains this tag <link=description>name</link>. While hovering this link a popup opens with a name from this link and a description also from this link.

    Sometime the description in this link contains more tag like this, but the parsing breaks at this point.

    Any way to utilize the link tag to get this
    <link=description<link=description>name</link> >name</link> to work ?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You should be using quotes in the tag definitions such as:
    <link="Unique Link ID">The text affected by the link</link>

    Nesting of link tags is not possible or using a tag in the Link ID.
     
  3. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
    Is there a way to add a custom tag ?
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    No.

    However, you might be able to use the Stylesheet feature and define a custom style to potentially achieve the result you seek. I would need more information about your use case for this nested link tag to confirm if <style> tags could be used for your needs.
     
  5. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
    Ok, basically a card has a description. This description should be short, but sometimes specific Keywords needs a specific description.At this point the link tag works perfect. <link="description">Keyword</link> a player hovers over the link a popup opens that shows the description.
    Sometimes a description contains another keyword. <link="description<link="description">Keyword</link> ">Keyword</link> at this point a nested link in the linkId part would be perfect, but the parsing failes.
     
  6. Daegit

    Daegit

    Joined:
    Nov 20, 2015
    Posts:
    32
    I checked out if styles and the stylesheet feature work for me.
    On the first try it seems to work. But since there is no option to add one style via code,only through the editor, its not an option. Any other ideas ?