Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: franktinsley on October 08, 2012, 03:41:28 PM

Title: UIAnchor for relative positioned widgets in a 3D UI
Post by: franktinsley on October 08, 2012, 03:41:28 PM
I have a 3D UI setup so I can use slick 3D animations and everything was working great until I tried to get some relative positioning working. I can make it work no problem on a 2D UI but when I try to add it to a 3D UI I get a lot of weird results. Is there an example or tutorial somewhere showing both relative UI placement (i.e. buttons that stay near the corners of a screen when it changes aspect ration) AND a 3D UI? I can't seem to find how this is supposed to be setup.
Title: Re: UIAnchor for relative positioned widgets in a 3D UI
Post by: ArenMook on October 08, 2012, 04:44:47 PM
Why are you using anchors here to begin with? Just position your objects yourself like you would any other game object -- by moving them in the scene view.
Title: Re: UIAnchor for relative positioned widgets in a 3D UI
Post by: franktinsley on October 08, 2012, 05:20:59 PM
Well, as I understood it, UIAnchors were used to position objects relative to the screen or other things. Maybe they don't make sense in the context of a 3D UI?
Title: Re: UIAnchor for relative positioned widgets in a 3D UI
Post by: ArenMook on October 09, 2012, 05:49:07 PM
Don't use them on individual components. It's more for anchoring groups of wigets (think: parent game object).
Title: Re: UIAnchor for relative positioned widgets in a 3D UI
Post by: franktinsley on October 10, 2012, 07:17:19 PM
I figured out what I was doing wrong. I had anchors as children of panels. This appears to not be how they're intended to be used. Once I started animating my widgets differently to make them move together without keeping them in a single panel it all started to work. I've got 3D UI AND relative positioning! Yay!
Title: Re: UIAnchor for relative positioned widgets in a 3D UI
Post by: mdeletrain on October 11, 2012, 04:48:05 AM
Yes but you also got more draw calls...