Search Unity

TextMesh Pro TextMesh Pro + Sprite Asset - Order in Layer

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by josephsaade, Apr 5, 2019.

  1. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    46
    Hello,

    I have a TextMesh Pro object that uses a sprite asset.

    I have set the Order in Layer field, when the game runs the text is rendering fine but the sprite asset is rendering below other elements.

    Is some flag that I need to set specifically for the sprite asset?
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,603
    I presume you are referencing / using normal <TextMeshPro> objects. Correct?

    When you describe setting the Order in Layer on the text object, you mean in the Extra Settings of the text object as seen below. Correct?

    upload_2019-4-5_13-18-18.png

    Since Sprites / Inline Graphics are contained in child SubMesh objects, these also have their own controls for Sorting Layer and Sorting Order as seen below where you can control the sorting.

    upload_2019-4-5_13-23-25.png
     
  3. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    46
    Thank you
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,603
    The option is there for the normal <TextMeshPro> component that works with the MeshRenderer but it is not available for the <TextMeshProUGUI> component that works with the Canvas system and CanvasRenderer since sorting order with the Canvas system is determined by scene hierarchy.
     
  5. ThisIsDangerous

    ThisIsDangerous

    Joined:
    Dec 3, 2018
    Posts:
    16
    Yeah, I figured out I was looking at a wrong one. You managed to reply just before I deleted my post :)
    Sorry.