Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

custom full-color glyphs in the middle of a UI text?

Discussion in 'Unity UI & TextMesh Pro' started by JoeStrout, May 18, 2018.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    7,538
    I need to display some custom little images (controller button icons) in the middle of regular text in the UI. These are full-color images, so I don't think this is something I can just build into a custom font.

    With UI.Text, I think I'd have to use something like Unity-UI-emoji. But perhaps with TextMeshProUGUI there is an easier solution?
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,996
    This can easily be accomplished done with TMP.

    Create a TextMeshProUGUI object and type "Press <sprite=0> to Start!>"

    In this case, you'll get some emoji but if you create your own Sprite Asset from some texture that contains the images you want to display, it will work the same.

    See the following video which covers the Sprite Asset Creation Process.

    See the following additional information about using the Sprite tag with TMP.
     
    Martin_H and JoeStrout like this.
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    7,538
    Perfect, exactly what I needed!

    Thanks for being awesome.