Search Unity

TextMesh Pro Using TMP with Texture Packer

Discussion in 'UGUI & TextMesh Pro' started by boadleFTG, Nov 23, 2017.

  1. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    Is there a way to import atlas UV positional data from Texture Packer Importer (third party tool) into the TMP SpriteAsset, rather than have to type it in manually every time I make a change?

    Thanks
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Take a look at the "Window - TextMeshPro - Sprite Importer" menu.

    See the following post on the TextMesh Pro user forum.
     
  3. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    Wonderful! Thank you so much Stephan!
     
    Stephan_B likes this.
  4. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    Follow-up question. We've noticed that whenever the SpriteAsset is recreated (for example if more glyphs are added), we lose the connection between the UI prefab that contains the TMP component, and the sprite asset. The latter then has to be reassigned to the former.

    Is there a way to prevent this connection being lost?
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    When sprite assets are created through the importer, they are essentially new and have their own GUID which would be different than the previous one that was created hence why the connection is lost.

    When I have time, I can take a look to see if I can make it retain the GUID when saving over the previous sprite asset.
     
  6. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    That would be very useful for us!
     
  7. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    Is there a way to make the TMP component ignore the case of the sprite sheet element ID?

    Eg this works:
    <sprite name=ui_icon_controller_xbox_a>

    But these don't:
    <SPRITE NAME=UI_ICON_CONTROLLER_XBOX_A>
    <sprite name=UI_ICON_CONTROLLER_XBOX_A>

    This is a problem for us because our localisations tool capitalises the strings in certain circumstances.
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The name of the sprite is case sensitive so I would suggest perhaps always naming these sprites using upper case if your localization system uses that.

    I would also suggest always using quotes for the name of the sprite or sprite asset. Ie. <sprite="Name of Sprite Asset" name="Name of Sprite">

    The new text system will be case insensitive.
     
  9. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    Thanks Stephan! We did try the ID's in uppercase, and it didn't seem to work, but we will try again.

    When you mention the 'new text system', is there a new version that's being rolled out soon?
     
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    No ETA yet on the new text system which I am working on. So keep using TextMesh Pro and whatever updates show up until then :)
     
    boadleFTG likes this.