Search Unity

TextMesh Pro Is it possible to create an OnEnter/Exit event for text sprites?

Discussion in 'UGUI & TextMesh Pro' started by Fikule, Feb 17, 2019.

  1. Fikule

    Fikule

    Joined:
    Dec 25, 2014
    Posts:
    19
    Essentially I'm hoping it's possible to identify a sprite when mousing over the text.

    The goal is to have a combat log where any sprite can be moused over to show a tooltip, or ideally, an area of text.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    It is possible indeed.

    Take a look at example "12a - Text Interactions" included in the TMP Examples & Extras.

    This example shows how you can track interactions with elements of the text which includes sprites.
     
    Last edited: Feb 17, 2019
    Fikule likes this.
  3. Fikule

    Fikule

    Joined:
    Dec 25, 2014
    Posts:
    19
    Thanks, that's exactly what I was looking for!
     
    Stephan_B likes this.