Author Topic: Setting Depth Programmatically  (Read 2315 times)

cchute

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Setting Depth Programmatically
« on: September 15, 2014, 01:51:51 PM »
Hello I am having an issue with Labels when they are instantiated from prefabs.

It seems pretty simple but I can't find a solution. Basically I instantiate a label, and set it's depth to -10 for example.

When doing so, it is drawn in front of all other objects. For instance a UISprite at depth -3 is behind this Label. Is this a bug or perhaps I am missing something?

Thanks in advance

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Setting Depth Programmatically
« Reply #1 on: September 16, 2014, 09:14:51 AM »
The depth is relative to the parent panel. Everything drawn is first determined by camera depth, then panel depth, then widget depth.