Author Topic: Problem with sprite order, depth/Z values [images]  (Read 2497 times)

tokola

  • Guest
Problem with sprite order, depth/Z values [images]
« on: June 28, 2012, 05:31:24 PM »
Hi there,

I have been struggling for quite a while about implementing a -seemingly- straightforward popup for my interface. Basically, the popup should appear upon clicking a button and cover everything behind it. I have tweaked too much with Z values and Depth of my components with no success; on the contrary I find their functionality totally unpredictable :o. All my elements belong to the Fantasy Atlas, so there shouldn't be a problem there (referring to this thread: http://www.tasharen.com/forum/index.php?topic=767.msg3947#msg3947)

I include 3 screenshot to make things clearer than explaining everything. Notes: you can see the Z and Depth values for the pop-up window 'InputWindow' (green) and 'Label1' (red) for every instance. The whole background appears on the far left; I have no idea why the popup window is so far to the right. Additionally, the slightest change in its Z value (<1) causes it to move much more than other objects (as is visible between images 2 and 3 for a -0.25 change). Z values for their parent objects (empty object containers) are 0 for both cases (label and window).

Does anyone have any idea what might be the issue here? Under no circumstances can I move the list items behind the brown window!  >:(

Thank you for your comments/advice.

KatieFish

  • Guest
Re: Problem with sprite order, depth/Z values [images]
« Reply #1 on: June 28, 2012, 07:37:22 PM »
I also struggle with these Z issues frequently. And i have no idea how to properly fix these problems.

But one thing to know is that the drawing is controlled by UIPanels- each UIPanel has a draw call. You might have too many or too few. You could try giving the popup its own UIPanel, as i assume your table already has a UIPanel of some kind. This is only a guess. =/

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem with sprite order, depth/Z values [images]
« Reply #2 on: June 29, 2012, 03:04:34 AM »
Your popup needs to have its own UIPanel.

tokola

  • Guest
Re: Problem with sprite order, depth/Z values [images]
« Reply #3 on: June 29, 2012, 05:28:14 PM »
Thanks a lot guys, that was eventually it!