Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Isamson on April 30, 2014, 02:52:32 PM
-
Hi,
I'm attempting to move the parent of a uitable while it's performing a Center on child. For some reason the tween within the Center on child stops if the objects parent is moved or tweened.
Is this a normal behavior? Is there a workaround for this?
Edit 1: Here is what I noticed:
The Spring Panel's Target XYZ usually matches the x,y,z position of the UIPanel. But if I move the parent of the panel doing the Center on child, the UIPanels X position (the one being tween by the Center on child) changes to a different value. It basically un-syncs with the Spring Panel if it's moved and the Center on child simply stop centering the panel.
-
UICenterOnChild goes to a specific position. If you move the children after it's initiated, it will effectively be moving to the "old" position.
-
Is there anyway around this? I was under the impression that the Center on child was using the Local Position, so I thought it wouldn't be influenced by a tween on the parent.
-
UICenterOnChild just uses SpringPanel, which uses local space coordinates. It adjusts the panel's position by one value and the clip offset by the opposite, thus resulting in the content moving into place. Can you draw the hierarchy of where everything is?
-
Sure thing,
UIRoot
- camera
-Panel (main)
-anchor
- offset (empty GO)
- tween (this is the object moving)
- offset for Panel
- Panel (clipped) containing the Spring Panel
So I'm tweening the tween at the same time I'm calling the center on child.
-
Aside from it being overly complicated, and the fact that there shouldn't be the "anchor" there, I see nothing wrong with the hierarchy, so I honestly am not sure what to suggest.
-
I'll find a work around. Probably do the tween first and after that apply the spring panel.