Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

TextMesh Pro Text Mesh Pro does not work with spriteatlas assets.

Discussion in 'UGUI & TextMesh Pro' started by sidespin, Jun 18, 2019.

  1. sidespin

    sidespin

    Joined:
    Jun 22, 2018
    Posts:
    19
    When I try to create a Text Mesh Pro Sprite Assets it says "A texture which contains sprites must first be selected in order to create a TextMesh Pro Sprite Asset."

    What's the proper way to use the spriteatlas file I already have?
     
    Laicasaane likes this.
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,272
    The Atlas Texture must first be set to Sprite Mode and you also need to define those sprites in the Sprite Editor.

    Once the above has been done, you can then create the sprite asset.

    The following video is a bit old but most of its content is still applicable.
     
  3. sidespin

    sidespin

    Joined:
    Jun 22, 2018
    Posts:
    19
    Hi Stephan, thanks for replying. Actually I was referring to the new Sprite Packer which allows the use of .spriteatlas asset (references a folder and pack them behind the scene). TMP does not seem to work with this type of asset. Instead, I'll have to create a Multi-Sprite asset. This is a burden on the pipeline. Because every I add a new icon to the sprite it requires

    1. specify sprites source files to be packed
    2. create the spritesheet atlas texture/metadata using 3rd party software
    3. import it to Unity as Multi-Sprite and preserve the atlas information
    4. create/update the TMP Sprite Asset

    Is there any plan to support the new .spriteatlas format?
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,272
    I would love to support the sprite atlas system. It is simply a matter of time / priorities. So much to do and so little time.

    P.S. In release 1.4.x and 2.0.x of TMP with Dynamic SDF support, the structure of Sprite Asset has changed to include a Sprite Character Table and Sprite Glyph Table. The Sprite Glyphs now include the Glyph Rect which corresponds to the UV coordinate of the sprite in the texture. This is the part that needs to get updated based on where the sprite atlas system placed the sprite glyph. In addition, we need to make sure we point to the correct texture as there could be more than one but this is something TMP already knows how to handle with font assets. All this to say, this could be implemented.
     
    Laicasaane likes this.
  5. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    52
    Suddenly our project also in need of this feature. We have a bunch of small sprites and just want to use Unity Sprite Atlas to pack them then create TMP Sprite Asset out of that atlas. We just don't want to use another tool to create and maintain a spritesheet.
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,272
    I did explore adding support for the Unity Sprite Atlas but some functionality is not available yet. I am having discussions with the 2D Team but don't have an ETA from them as to when / if the required functionality will be added.

    The main issue is the Sprite Atlas pointing to the individual sprites in the Editor and to the atlas in playmode. The desired behavior is once packed, they should always point to their combined atlas. In addition, retrieving sprites results in allocations of clones of the sprites which is an issue as we want a reference to the actual source sprites.

    Hopefully, the 2D Team can add the required functionality for this to be supported.

    In the meantime, I understand the desire to not use an external tool but that is the only solution at this time.
     
    Laicasaane likes this.
  7. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    852
    That would be really awesome because as it stands every time I have a new icon, I must recreate an entire sprite sheet with a 3rd party program and that takes time. Really looking forward to this feature!
     
  8. DimaHubenkoGamepoint

    DimaHubenkoGamepoint

    Joined:
    May 16, 2018
    Posts:
    7
    Bump, really needed feature. Also I'd like to say that we are interested in "animated sprites" in text - for example animated smiles. By now the only solution I see is to replace image in atlas by timer, but that requires SubMesh regeneration. This animated feature is needed only for same size sprites, so regeneration can be skipped...
    Is there any better proposition?
     
  9. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,272
    As per my previous post, adding support for the Sprite Atlas system would most certainly add value and something that I will be adding at some point. My challenge is simply too many things to do with so little time.

    With regards to animated sprites, this can be achieved using the <sprite> tag with anim attribute as seen in this example / post.
     
  10. Michal_Stangel

    Michal_Stangel

    Joined:
    Apr 17, 2017
    Posts:
    59
    Bump. Just migrated to Unity's Sprite Atlas system and realized that it cannot be used for TMP's sprite displaying.
     
unityunity