Hi,
I recently started using NGUI for some project and I got some behavior I don't understand using UIDraggablePanel.
So when starting my scene I instantiate a prefab with the UIRoot, UICamera and this hierarchy under the camera :
UIRoot
UICamera
Anchor (Center)
UIPanel
BG Sprite + UIDragPanelContents (with the panel just below as the target)
UIPanel + UIDraggablePanel (scale 0 1 0)
UITable (1 column, Down)
I also have a prefab that I want to instantiate several times as a child of the UITable. It is composed like this:
GameObject
UISlicedSprite + UIDragPanelContents (set the target by code)
UILabel
If I add several instances of this prefab by hand to the UITable in the editor or when I do it by code with the NGUITools.AddChild(parent, prefab) function, I have 2 problems :
- first the UITable is moved in such way that its top-right corner is now at the center of the UIDraggablePanel
- then, when I clicked the only part of 1 element visible in the clipping area, the UIDraggablePanel is moved a lot on the left. The UITable si moved too.
So my question is : what did I do wrong or forget to do ? Why are these 2 widgets moving around ?
Thanks in advance for your help
Benjamin