Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: SuperTalesNat on May 13, 2013, 08:05:17 PM
-
Hey all, i'm seeing some interesting behavior on the UIDragPanel / UIGrid structure.
I've got a soft clipped UIDraggablePanel thats 0,0 for centering of the panel, a size thats scaled to 1850 and a softness of 150. This Panel has a SpringPanel attached to it.
Under this panel i have a UIGrid GameObject, Horizontal, with 6 objects inside that are 400px wide each, and these GameObjects are also CheckBox buttons, with a root parent of the Panel for a 'currently selected' functionality.
When i scroll the buttons to the left to see the occluded last 2 buttons out of 6, everything works great. If however, i click on one of the buttons from the left (buttons 1-4 out of 6) then the button shifts to its original place in x & y, and brings along the entire panel as well, applying the delta of the translation in X to the 'center' of the panel.
This cause issues as the panel is soft clipping, and so the buttons suddenly become clipped due to the panel moving.
If i turn off the clipping, then everything works fine, and nothing breaks, albeit i can see ALL 6 buttons in Unity, on screen or off.
So with all of that above, has anyone seen this before? What t make of it? Why is the button press applying the move to the parent panel?
Trying to figure out how to get around this, any help or someone who has seen this issue before?
-
Yeah I ran into that, drove me crazy and then I read Aren's comment that Drag conflicts with CenterOnObject, chose one or the other so I dropped the drag :(
-
Too bad for me though, as i dont have CenterOnObject on this UI right now (its free form drag only), so that cant be the issue :-(
-Nat
-
SpringPanel script is what moves the panel, and it's used by both the draggable panel and CenterOnObject. It's also the script you said you're using -- so yes, you have a conflict. The panel tries to keep everything within bounds by default, using SpringPanel to move it into place.
-
Ahh, ok, good to know, thanks!
-Nat