Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Liviuss

Pages: [1]
1
NGUI 3 Support / Moving UIPannel with nested anchored widgets
« on: March 20, 2016, 06:41:57 AM »
Hi,

I'm dealing with a anchoring problem and don't know how to solve it.
I have multiple panels under UIRoot setup as follow:
UIRoot(constrained by manual height with fit)
|- UICamera
|- Pannel1
   |- Widgets
|- Pannel2
   |- Widgets

Pannel2 is disabled by default and is local-positioned at (0,0,0). All nested widgets are anchored to Pannel2 with unified anchor type.

At runtime, i set the local-position of Pannel2 to (0, 700, 0) and after that i enable the pannel GO. The strange thing is that all nested widgets does not  take in account the localposition of the Pannel2 and they are immediately visible in the View with an transform position offset(0, 700, 0) relative to position of Pannel2. When you animate the Pannel2, move it down to the view, all widgets move out of view of course.

I have tried many setups by adding an empty widget between panel and widgets, set advanced, even do on Update anchoring, but anchoring system just ignore the localposition of the anchor root. Seems that Anchoring system deal with anchor root initial position as a Vector3.zero position.

Is there a solution to make anchoring take into account local-position?

P.S. Seems to be related to http://www.tasharen.com/forum/index.php?topic=11187

Thanks!

P.S.S. I use NGUI 3.9.7, Unity 5.3.4f1 MACOS

UPDATE: By setting "Offset anchors by position" solved this issue but a precondition for this is to have UIRoot at Vector3.zero position. If UIRoot is moved somewhere away(just to not have-it in the middle of editor screen) you will get strange positions on anchored widgets. I feel that anchoring it's a bit messy when it come to world/local positions.

Pages: [1]