Author Topic: Depth error using different Atlas  (Read 1963 times)

PhoerLevine

  • Guest
Depth error using different Atlas
« on: November 30, 2012, 08:25:45 AM »
I've two atlas with different sprites, and when I try to print some images using both atlas there's some problem with depth sorting. I've a background and a button in one of those atlas, and and image in another one, and I want to sort it like this:

background
image
button

But when rendering the order is:

background
button
image

I tried everything: varying the element's Z axis, varying the UISprite's depth... Any idea?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile

PhoerLevine

  • Guest
Re: Depth error using different Atlas
« Reply #2 on: December 03, 2012, 03:22:26 AM »
Thanks for answering, but still doesn't works. In that post says to adjust Z axis, but when doing that it still shows what I said:

background [atlas: 1, z: 0, depth: 0]
button [atlas: 1, z: -10, depth: 0]
image [atlas: 2, z: -5, depth: 0]

Even varying depth on the inspector in play mode doesn't works... I've also read I could use different panels, but is that the only way to solve it?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Depth error using different Atlas
« Reply #3 on: December 03, 2012, 08:04:47 AM »
Yes. You can't sandwich atlas 1 and atlas 2 in the same panel, because all widgets in the same panel and in the same atlas is batched into a single drawcall.

PhoerLevine

  • Guest
Re: Depth error using different Atlas
« Reply #4 on: December 03, 2012, 08:36:03 AM »
Hmm... Understood, thanks