Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    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. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. 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:
    7,278
    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,723
    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,278
    Perfect, exactly what I needed!

    Thanks for being awesome.