Author Topic: Problems with UIDraggablePanel  (Read 5266 times)

Grhyll

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Problems with UIDraggablePanel
« on: September 28, 2012, 11:05:34 AM »
Hello !

I've been looking for answers here for some times, but I'm wondering if I wouldn't have made a mistake somewhere, because I think my problems are not the normal behaviour of the scroll view.

There is two of them:

- Some of the items in my UIDraggablePanel are not hidden when out of the scrolling area. I think I did not have this problem at the beginning, but I can't remember anything I would have done to change that.
The title on top of the UIDraggablePanel disappears when dragging the panel up, but the next items do not... Some of them are created dynamically. Is there an option or something I could have changed without noticing that would cause that?

- I can't drag the scroll view when scrolling from a button. I've read in another topic that there is an option for this in the UICamera, and I've tried to set it to a very little value, but no matter how far I drag from the button, the scroll view does not move if I began in the collider of the button. Any idea on this?

dreamora

  • Guest
Re: Problems with UIDraggablePanel
« Reply #1 on: September 28, 2012, 11:11:55 AM »
1. Are you sure you properly call the Refresh on the panel when adding childs programmatically? and in case you use something like UIGrid / UITable that you call their reposition functions

2. Potentially you want to add a component (or use your button handler script) with OnPress and OnDrag defined that call the Press and Drag functions of UIDragPanel to forward the drag drop to the list as well. You could limit the Drag forwarding to a certain minimum drag distance for example (found from NGUITools.FindInParents<> (go))

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problems with UIDraggablePanel
« Reply #2 on: September 28, 2012, 12:46:52 PM »
Widgets may not disappear if one of the game objects leading up to your panel is not using a uniform scale (ex: 1.123, 1.0, 1.0 instead of 1.0, 1.0, 1.0). They may also not disappear properly if you're targeting GLES 1.1, as shaders don't work with GLES 1.1.

Each collider that you want to scroll the panel must have UIDragPanelContents on it.

Grhyll

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: Problems with UIDraggablePanel
« Reply #3 on: October 01, 2012, 04:32:03 AM »
- UIDragPanelContents works perfectly, I guess I missed it in the tuto...

- About widgets that do not disappear, I have found the reason: one of my game objects under the draggable panel had a UIPanel script on it, which prevented the objects to disappear, and my prefab themselves had this script (I thought it was a good habit to attach this script to empty gameObject only here for hierarchy). I removed it, and now it disappears perfectly.

Thank you for your very quick answers!

Grhyll

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: Problems with UIDraggablePanel
« Reply #4 on: October 01, 2012, 05:05:15 AM »
Note: I had another strange issue; the prefab I insert into the draggable panel has 2 labels, and when I dragged the panel more than a dozen of pixels, those labels disappeared as soon as the scroll panel stopped moving, and only reappeared when moving again.
I tried to set the z-coordinate of one of those two labels to -1, and now they do not disappear anymore (both of them!). I don't really understand it, but at least it's working.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problems with UIDraggablePanel
« Reply #5 on: October 01, 2012, 04:38:45 PM »
The clipped panel should be offset from the background panel by adjusting the Z, otherwise Unity can't determine what should be in front of what.