Search Unity

  1. Full schedule for #UniteBerlin is now available! Featuring talks on our roadmap, hands-on labs and much more! Check it out!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. 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
  6. 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 at 2:50 PM.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    6,612
    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,207
    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.
     
    JoeStrout likes this.
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    6,612
    Perfect, exactly what I needed!

    Thanks for being awesome.