Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Text2DRenderer and LayerSorting

Discussion in 'Project Tiny' started by ER_Dolleman, Jan 8, 2019.

  1. ER_Dolleman

    ER_Dolleman

    Joined:
    Dec 10, 2018
    Posts:
    19
    Can I change the layer/order of a Text2DRenderer so that it's in front of other things?

    It's possible with a Sprite2DRenderer, but there doesn't seem to be an option for that for a Text2DRenderer.
     
  2. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    192
    Add LayerSorting Component
     
  3. ER_Dolleman

    ER_Dolleman

    Joined:
    Dec 10, 2018
    Posts:
    19
    Thanks for your reply. That component doesn't seem to work with a Text2DRenderer, only with a Sprite2DRenderer.
     
  4. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    192
    It seems to work in my project
     
  5. ER_Dolleman

    ER_Dolleman

    Joined:
    Dec 10, 2018
    Posts:
    19
    This is how I have set up the entity:

    mytext.png

    The text is always behind sprites with an order above 0
     
  6. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    192
    I'll take a look when I get home
     
  7. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    192
    Here is mine. . . note this Entity is a child of the camera. . . so it moves with my player it is a workaround
     

    Attached Files:

    • font.png
      font.png
      File size:
      28.2 KB
      Views:
      256
    ER_Dolleman likes this.
  8. ER_Dolleman

    ER_Dolleman

    Joined:
    Dec 10, 2018
    Posts:
    19
    It does work with the LayerSorting component now, not sure what I changed.
    It does not show it in the editor or in the game view, so that got me a bit confused.
     
    vincismurf likes this.