Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: wallabie on April 25, 2014, 01:30:46 AM

Title: Drag drop from one scrollView to another.
Post by: wallabie on April 25, 2014, 01:30:46 AM
I have 2 scrollViews.

A: vertical scrolling, Grid: horizontal.
1 2 3
4 5 6
7 8 9

B: horizontal scrolling, Grid: horizontal.

1 2 3 4 5

This is on mobile, A is directly above B and no spaces left and right of both scrollViews.

I need to drag from A to B and vice versa.  When dragging from A to B, the item is being dropped but only to A.   
Title: Re: Drag drop from one scrollView to another.
Post by: ArenMook on April 25, 2014, 09:16:40 AM
If item is being dropped only to the first list, then you didn't set it up quite right. Look closer at how the two drag lists are set up in the drag & drop example. The only thing different in yours is you changed one scroll view to scroll horizontally, implying you also need to change the drag restriction to be vertical instead of horizontal or you won't be able to start dragging items.
Title: Re: Drag drop from one scrollView to another.
Post by: wallabie on April 25, 2014, 10:20:04 AM
I did a test with Example 11- Drag& Drop.

1. I made the same configuration that I needed and found that when the bottom scrollView B  is empty, then dropping an item from ScrollView A doesn't work.  It only works when the drop intersects an already existing item in B.



Title: Re: Drag drop from one scrollView to another.
Post by: ArenMook on April 25, 2014, 10:26:29 AM
Is there a collider where you're dropping the item?
Title: Re: Drag drop from one scrollView to another.
Post by: wallabie on April 25, 2014, 10:35:04 AM
I just took the existing example, reconfigured the Left and Right scrollView to my setup A and B. 

1.  I dragged everything from B to A. 
2.  with B empty, I tried adding items from A into B.


Edit:  Solved.  The collider is the problem,  in B when I made it into a Horizontal Scrollview, I forgot to resize the  Container-Right to match the same configuration.
Title: Re: Drag drop from one scrollView to another.
Post by: ArenMook on April 25, 2014, 10:50:30 AM
Is this something to do with your configuration? Does it work fine if you don't reconfigure anything? How can I reproduce it?
Title: Re: Drag drop from one scrollView to another.
Post by: wallabie on April 25, 2014, 10:52:31 AM
Thanks, on your clue I found the problem with my configuration.