Text Mesh Pro does not work with spriteatlas assets.

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?

2 Likes

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.

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?

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.

3 Likes

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.

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.

2 Likes

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!

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?

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 tag with anim attribute as seen in this [example / post]( TextMesh Pro - Advanced Text Rendering for Unity - Beta now available in Asset Store page-26#post-2792823).

2 Likes

Bump. Just migrated to Unity’s Sprite Atlas system and realized that it cannot be used for TMP’s sprite displaying.

1 Like

Yeah. I’m having a hard time figuring out how to use TMP in its current state. Everything I’ve seen shows me how to use a giant texture instead of what I have, which is one texture per image. Converting the many-loose textures into the consolidated mega-texture required by TMP seems time-consuming an error-prone. It seems like the cheapest course of action must be to write a build-time script that automatically generates one of these multi-sprite textures for the purpose of TMP every build. Is there a better option?

2 Likes

Until I get around / find the time to add support for the Sprite Atlas system, you can use an external tool like TexturePacker.

TexturePacker makes it easy to take several separate images and to pack them into a single texture.

To work with the TMP Sprite importer (Window - TextMeshPro - Sprite Importer), you have to use the JSON Array export option (included in the free version of TexturePacker). This produces a texture + data file (.json) that you will use to create the sprite asset.

There should be several threads on the forum about using the Sprite Importer. Here is one such thread where some issue was reported which has now been resolved but the thread still contains useful information.

Understandable. We all have to work to priority.

I found a tool that helped along those lines (Simple Sprite Packer). It was not too hard to use. I forgot to update this thread.

3 Likes

Gosh, I also didn’t expect that Sprite Atlas cannot be used for text sprites and that we have to maintain a sprite sheet separately, without any built-in tool available. :confused: So yeah, I’d like to bump the feature request of supporting sprite atlas files.

Edit: I’ll give Simple Sprite Packer a go, thanks for the hint, @MaxGuernseyIII

2 Likes

Yeah this is brutal.

Suddenly found myself today in need of this, so adding my voice here (given that I cannot find a proper issue to vote / watch)

Just hit this issue too. So I have to use a third party tool to pack sprites. Worse yet several TMP bugs exacerbate this workflow:

  1. If you change the sprite sheet you have to manually update the TMP sprite asset, but while the “Update Sprite Asset” command does that it doesn’t save the changes to the .asset file so you will lose those changes. Workaround is to diddle a glyph setting so the dirty bit gets set and it is saved.
  2. The sprite packer tool creates an asset with the same name and TMP will overwrite that file without warning when you create the TMP sprite asset.
1 Like

Still not supported:(…

Another hopeful vote…

Is there any progress on that feature?