Search Unity

Question Sprite acting like a button

Discussion in 'UGUI & TextMesh Pro' started by moonducks, Feb 19, 2024.

  1. moonducks

    moonducks

    Joined:
    Dec 28, 2020
    Posts:
    1
    Hi All,

    I have a TMP_Text field populated from a csv file each time the user does something. The text has some embedded sprite elements, using <sprite=0>, <sprite=1> etc tags. All working fine.
    How can I make these sprites clickable? Is there any way to add an onClick Listener so I can call a function when it's clicked?

    I googled it, and read countless forums, but I still didn't get any answers.

    Any ideas?
    thanks