Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: makeshiftwings on July 11, 2012, 02:25:26 PM
-
I'm having some weird issues trying to use a semi-transparent window with a tooltip. The window has a semi-transparent background, but the labels in it are opaque. You can see how it normally looks in image one. The tooltip is opaque, no transparency. When the tooltip pops up though, it messes with the window in the background, and seems to cause it to render in the wrong depth order. When I had the window's background and labels on the same Z-axis value, but different Depths, it rendered fine normally but then when the tooltip came up, it would render the labels behind the window instead of on top of them, as if it had reversed the depth order. When I put the labels one unit closer on the Z-axis than the background, it again looks fine normally, but when the tooltip comes up it renders a corrupt looking version, as if it's partially behind the window and partially above it (see image 2). If I move the labels to a higher Z-axis than the tooltip they stay normal but then the tooltip renders behind the labels, which is not what I want. I believe NGUI isn't supposed to care about the Z-axis most of the time and just rely on the depth order (which is set correctly), but it seems to get a little weird with transparent pieces. Any idea on how I can fix this?
http://imgur.com/wxtL7,0XoLS#0
(http://imgur.com/wxtL7,0XoLS)
http://imgur.com/wxtL7,0XoLS#1
(http://imgur.com/wxtL7,0XoLS#1)
-
You should place the popup on a different panel, or it will always be screwing up something.
-
Ah, that fixed it. Thank you! It's been bugging me for a while. :)
What are the guidelines on what should be in its own panel? I was trying to put as much as possible into a single panel to minimize draw calls but now I'm thinking that it would be better to have any windows/widgets that dynamically appear on top of others each in their own separate panel to avoid glitches like this when they overlap?
-
No guidelines, just common sense. Think of it as such: if it's a new window, make it a new panel. You can define a "window" as a group of widgets that move or appear together.