Author Topic: NGUI resorting depths  (Read 1882 times)

Tatanan

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 0
  • Posts: 81
    • View Profile
    • Casual Arena
NGUI resorting depths
« on: November 14, 2014, 10:37:44 AM »
Does NGUI re-sort depths in some cases (like gaps between depths or negative depths?
Actually, it's not a question, I am seeing that indeed NGUI re-sort depths in some cases, so the question is
Why?
and
When?

Thank you.
Game developer on Casual Arena.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI resorting depths
« Reply #1 on: November 15, 2014, 04:16:57 PM »
It's just an integer value. The list is sorted by it.

Tatanan

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 0
  • Posts: 81
    • View Profile
    • Casual Arena
Re: NGUI resorting depths
« Reply #2 on: November 15, 2014, 07:13:11 PM »
I think I didn't make correctly the question.
I know they are integers.
Let's suppose my depths are:
-2
-1
0
2
3
Then, when I click on "Play", those integer becomes 0, 1, 2, 3 and 4, so I can't trust on these values, for example, for adding my own depth programatically.
Is it clearer now the question?
Game developer on Casual Arena.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI resorting depths
« Reply #3 on: November 17, 2014, 08:49:48 AM »
Depth values don't change unless you change them. Your -2 -1 0 2 3 will remain as such. Nothing will change them to 0 1 2 3 4. Only normalizing depths or using ALT+SHIFT+= (or minus) will place them in order like that.

Tatanan

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 0
  • Posts: 81
    • View Profile
    • Casual Arena
Re: NGUI resorting depths
« Reply #4 on: November 17, 2014, 10:03:14 AM »
For some reason the values on my scene do change. I don't know why and I haven't writen any code for doing this.
Maybe I'm using NGUI class which does it internally, I don't know.
Don't worry then, it's not a real problem.
Thank you.
Game developer on Casual Arena.