Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: yuewah on April 27, 2012, 12:23:12 AM
-
I am using NGUI 2.0.3e, Unity3d 3.5.1 and tested on iPhone 3GS, iPad1
UIPanel
--UISprite
--UILabel
the UISprite and UILabel with different Material and its Z order is 0.
In the Unity Editor, UISprite is on top of UILabel, while in iOS devices, UILabel is on top of UISprite.
-
If they use different materials, you need to tell Unity which one is in front by adjusting the Z.
-
Is it very hard to make the iOS device and Unity3d editor behave the same ?
-
It's easy. As I said, adjust the Z. Bring one of them forward (the label) by adjusting the transform's Z (set it to -1).
-
If they have the same Z and are in different atlases, it's a little bit random which gets drawn first - so don't do that. It's the same if things in the same atlas have the same depth. Having things in the same atlas and not setting depth to something different is bad, mkay?
Remember if you have two atlases, you need to bring forward everything from the one you want most forward, or split it up into different Panels, otherwise things will get weird if you for any reason disable the one thing brought forward on the z axis, like in a scroll view.
-
but it is pretty trouble if there are so many UISprite and UILabel over the screen, as what i expected is what I see in editor should be the same as device.
-
Actually it's not guaranteed to stay the same in the editor. The results are undefined if you don't specify a different Z value. It's the same as specifying identical depth on widgets within the same atlas. Their order is undefined that way. One may be in front of the other in edit mode, then the opposite when you hit Play.