Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    6,995
    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,518
    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:
    6,995
    Perfect, exactly what I needed!

    Thanks for being awesome.