Search Unity

TextMesh Pro Inline icons not working on iOS and Android devices

Discussion in 'UGUI & TextMesh Pro' started by ldaughtry, Feb 24, 2020.

  1. ldaughtry

    ldaughtry

    Joined:
    Oct 30, 2012
    Posts:
    38
    I'm having an issue where inline icons in a TextMeshProUGUI component are working in all other builds of my project, but I'm just getting the markup text in iOS and Android builds. This includes editor playing of the iOS or Android projects, meaning I'm seeing the icons properly in the Editor for those platforms but not on hardware. I'm not getting any errors/warnings. I'm in:
    Unity 2019.1.14f1
    TMPro 2.0.1

    I can't find any forum chatter of this happening elsewhere. This happened when I upgraded the project from Unity 5.6.x to 2019.1.x and the subsequent TMPro upgrade that was required. All other TMPro functionality is working as exected.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Make sure the following is enabled in the TMP Settings.

    upload_2020-2-23_17-59-11.png

    Also make sure the path and the location of your sprite assets is correct which it should given these show up on other platforms.

    Just in case the issue is specific to you Sprite Assets (maybe they didn't get converted correctly in the migration process from 5.6 to 2019.1 by the Project GUID Remapping tool), see if you get the same behavior creating a new scene with a single text object that contains <sprite=0> which should grab the sprite from the default sprite asset assigned in the TMP Settings.

    Let me know the results of the above and we will go from there.
     
  3. ldaughtry

    ldaughtry

    Joined:
    Oct 30, 2012
    Posts:
    38
    Ok,

    The TMP_Settings asset is set correctly as you surmise.

    I made the test scene, it works as expected. I have a canvas and two TextMeshProUGUI component's. One is getting sprites assigned by index and by name in the body. And one is getting sprites assigned in the body by index and name via a Start() method. Both cases are working as expected.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Try the same test scene but using your own Sprite Asset instead.

    Not sure if it was possible in the older versions to assign a Sprite Asset to local text object in the Extra Settings panel of the text object but it is now in the newer releases. As such assign your Sprite Asset there and see if everything still works?

    Let me know how it turns out?
     
  5. ldaughtry

    ldaughtry

    Joined:
    Oct 30, 2012
    Posts:
    38
    Ok, did a top down re-evaluate of everything to do with the inline sprites and found the issue and a fix.

    The TMP_SpriteAsset and the generated sprite sheet image itself were named the same thing, which had never caused an issue before. Renaming the sprite sheet image fixed the issue.

    Thanks for helping me prod at this.
     
    Stephan_B likes this.