Author Topic: [SOLVED] Strange Z and depth issues, Z have no effect anymore, in some cases?  (Read 1684 times)


  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 153
    • View Profile
Hey guys,

so this is like, the 3rd NGUI bizarre thing happening to me today.

I have two inventories/itemBoxes with their Z position set to 0 - and my UICamera eventType is "UI" - Which means that what you see in the attachment, is not a strange thing - Since UI eventType handles things via depths, and not Z.

Here's the thing: If I change the Z of the grey item box to be in front of the black one, it will go actually and be in front of it blocking it, so there's no intersecting between them, the grey one just sits on top of the black one, shouldn't this NOT happen? (see attch2) - Not just that, if I do the opposite and try to put the black one in front, I can't! (see attch3)

Not just that, here's one more :D - If I change the eventType to "World", it doesn't change anything! - The issues will remain, and changing the Z will have the same effects as in the last 2 situations!

I'm really lost here, I'm pretty sure that I'm not using any transparent material in the black inventory, and the alpha is full.


Any help, advice or explanation would be appreciated.

Thanks a lot.

EDIT: I know you'd tell me, that since I'm using UI as an eventType, I should be adjusting the depths. Yes, correct that works, but:

1- I was just wondering why this is all happening to me, since it shouldn't.
2- The two inventories (the black and the grey) are of a different panel (if that matters) - if I keep adjusting depths, this means that I have to keep track of all the depths! So like for the first inventory say I had background on 0, slots on 1 and labels on 2. In the 2nd inventory I'll have background on 3, slots on 4 and labels on 5! - This is annoying!

Please provide us proper ways to deal with this, as there is very little information about this. - The comments on the code doesn't clear all that much, and the online documentation was always known to be developer-oriented much more than user-oriented.
« Last Edit: November 10, 2013, 01:24:22 AM by vexe »


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Strange Z and depth issues, Z have no effect anymore, in some cases?
« Reply #1 on: November 09, 2013, 07:26:32 PM »
You need to give your panels different depth values. Without unique depth values, draw order is undetermined.