Search Unity

TextMesh Pro Choosing the default source for sprites

Discussion in 'UGUI & TextMesh Pro' started by AcademyOfFetishes, Feb 9, 2019.

  1. AcademyOfFetishes

    AcademyOfFetishes

    Joined:
    Nov 16, 2018
    Posts:
    219
    The docs say this: To use a sprite asset, put it in a Resources / Sprites folder. This allows TextMesh Pro to find it. You can also configure one sprite asset as the default source for sprites.

    How do I configure the sprite asset as the default source? It says you can, but it doesn't tell you how.

    Thanks!
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    In the TMP Settings, you can assign a Sprite Asset which will then become the Default Sprite Asset.

    upload_2019-2-8_22-9-11.png

    As such when using <sprite=0> or <sprite index=0> or <sprite name="sprite name">, TMP will be looking for that sprite in this default sprite asset.

    Please note that you can also assign fallbacks to sprite assets.

    You can also assign sprite assets to a text object in the Extra Settings section of the text object inspector. When a sprite asset is assigned to a text object, using <sprite=0> will then get the sprite from this sprite asset.
     
    momo_drest, Neohun, nbilling and 2 others like this.
  3. AcademyOfFetishes

    AcademyOfFetishes

    Joined:
    Nov 16, 2018
    Posts:
    219
    Thank you. :)
     
    Stephan_B likes this.