Author Topic: Draggable panel & drag and drop problem  (Read 3610 times)

rokcus

  • Guest
Draggable panel & drag and drop problem
« on: June 27, 2013, 08:12:41 PM »
 Hi I am stuck on those problem
first of all I am trying to do horizontal drag and vertical drag plus drag and drop of a item in the list.
here is my hierarchy

UIRoot
- Camera
   - anchor
      - horizontal panel
        - horizontal grid
           - Sheet1
              - vertical panel
                - vertical grid
                  - item1
                  - item2
                  - item3
                  - item4
                  - item5
            - Sheet2


here sheets are supposed to be on horizontal panel.
and the items are prefabed and supposed to be on vertical panel.
On sheet1  modifiied the drag panel contents script which alters the right panel so it works fine.
Also I modified the item pref if pressed for 0.5s it drags the item individually, also works fine.
However my problem is that if the individual item is dragged to edge of panel, the panel should be scrolled.
how am I supposed to do this? should I range the limit of panel and then manually scroll the panel with certain value?
or does ngui provide such function but I can't find one?
Did I explained clearly?

please help me out with this. This one has bothered me for a week now.
thank you

« Last Edit: June 27, 2013, 08:31:31 PM by rokcus »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Draggable panel & drag and drop problem
« Reply #1 on: June 28, 2013, 04:35:04 PM »
There is no such built-in function, you have to write it yourself based on the position of the mouse and the dimensions of the panel.

P.S. You know what clipping is not nested, right? You have nested panels, but their clipping won't nest.