Search Unity

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

Discussion in 'Unity UI (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:
    3,187
    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:
    3,187
    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:
    31
    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:
    3,187
    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.