Search Unity

A change in render order from original TextMesh Pro?

Discussion in 'UGUI & TextMesh Pro' started by bpdavis2006, Jan 30, 2019.

  1. bpdavis2006

    bpdavis2006

    Joined:
    Jun 3, 2013
    Posts:
    19
    I was wondering why the change was made to make text appear top-most? I like having the source code to projects, so I am upgrading from the TextMesh Pro Free version from 2016 to its latest incarnation. The free version put the text behind my sprites, which is what I want. The new version puts the text on TOP of my sprites, obscuring them. I've tried many different ways to set the "order in layer" of my sprite and also the mesh renderer for the text object, but nothing is letting me get the desired result.

    How can I get the results of the original TextMesh Pro Free version (without actually using the free version?)
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Are you using the <TextMeshPro> component or the <TextMeshProUGUI>?

    I am assuming you are doing something like "X <sprite=0>" and you want the X on top of the sprite?

    P.S. Thanks for posting this in its own thread :)
     
  3. bpdavis2006

    bpdavis2006

    Joined:
    Jun 3, 2013
    Posts:
    19
    As I look into this more, it seems to a layering issue. I'm rendering the text (I've tried both TextMesh and TextMeshPro) in one camera as a conceptual overlay. The text has a layer name of "instructions". The sprite that I want to appear on top (i.e. in front) of this text is rendered by a second camera. The sprite's layer is "gameplay". The camera rendering text is set up with its layer mask set to "instructions", while the second camera's layer mask is set to other masks including "gameplay".

    If I set both the text and the sprite in question to use the same layer, then everything works fine. Sorting can occur. It's when I render in separate layers that the trouble begins. How can I tell the renderer to sort the items in the order that I want?
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    So you are using the normal <TextMeshPro> component that uses the Mesh Renderer. Correct?

    Are these sprites coming from the use of the sprite tag <sprite> in the text or are you using a sprite object that uses the Sprite Renderer?
     
  5. bpdavis2006

    bpdavis2006

    Joined:
    Jun 3, 2013
    Posts:
    19
    I wound up changing my layer structure to better support the order layout needs. After this all works as expected. Chalk it up to a learning experience.

    Thanks for your interest and support!
     
    Stephan_B likes this.