Search Unity

[5.2] Adding an animated arrow image/sprite at the last letter of Text

Discussion in 'UGUI & TextMesh Pro' started by WilsonCWong, Jan 9, 2016.

  1. WilsonCWong

    WilsonCWong

    Joined:
    Mar 20, 2013
    Posts:
    35
    Hi,

    I want to add some sort of visual indicator in the form of an arrow at the end of the text to tell them that they should click on the screen to advance the dialogue, but I'm having trouble approaching this problem. Is there a way to add an image or sprite beside the position of the last letter in a text field?
    Here is a poor sketch I made in paint to show what I mean:



    Thanks in advance!
     

    Attached Files:

  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Tricky to do, you just have to either have a layout that places an image to the right of the text (probably a horizontal layout and using layout elements to fix the widths

    Alternatively check out TextMeshPro on the asset store which provides in-line images with text, as well as a much better and performant text system overall.
     
    Stephan-B and WilsonCWong like this.
  3. WilsonCWong

    WilsonCWong

    Joined:
    Mar 20, 2013
    Posts:
    35
    Ah, I figured it was difficult. I have looked at TextMeshPro before, and will definitely pick it up in the future. I guess I'll just delay implementing this feature for the time being or design another visual indicator that isn't as hard to make. Thanks for the help!
     
  4. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Since the subject of TextMesh Pro was brought up by Simon (thank you Simon btw :))

    Here is a glimpse of what's coming next to TextMesh Pro.



    This is a single text object using 5 different fonts and sprites. See the following post with additional information.
     
    SimonDarksideJ likes this.
  5. rzubek

    rzubek

    Joined:
    Aug 21, 2014
    Posts:
    72
    +1 to using TextMesh Pro for this. It makes is really easy to mix text and icons.
     
    Stephan-B likes this.