Author Topic: Drag and Drop AND Panel Scroll View  (Read 6583 times)

cowpirate

  • Guest
Drag and Drop AND Panel Scroll View
« on: May 23, 2013, 08:32:25 PM »
Hi,
NGUI Beginner here.
Working with NGUI 2.6.1c and Unity 4.1.2.
I need to create a panel that has a scrollable table with table items that can drag and drop.
I tried to make it using the NGUI sample scenes for reference (7. ScrollView Panel, 11. Drag & Drop).
Unfortunately I could not get these 2 functionalities to play together nicely.
I want to ask if there is a recommended way of doing this.

Ideally I would like it to behave like ios home screens where you scroll with your finger
and long tap to enter drag drop mode. Not sure how to accomplish this.
Is there a way to do this with NGUI ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Drag and Drop AND Panel Scroll View
« Reply #1 on: May 23, 2013, 08:51:29 PM »
2.6.1c is buggy, you need 2.6.1e.

GantZ_Yaka

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 21
    • View Profile
Re: Drag and Drop AND Panel Scroll View
« Reply #2 on: May 24, 2013, 01:54:16 AM »
How to make UIDraggablePanel, using only scrollbar to spring (not mouse touching) ?

cowpirate

  • Guest
Re: Drag and Drop AND Panel Scroll View
« Reply #3 on: May 29, 2013, 09:01:27 PM »
ok, I have updated to the latest NGUI version (2.6.1e).

I am still not able to drag and drop my 2d player icons back and forth between 2 tables.
The icons get messed up in the tables, or the icons can no longer be dragged after being dropped once.

I would appreciate it if someone could give me  a simple example of how to do this (which scripts get attached to which ui objects etc).

Example Criteria:
2 tables filled with 2d sprite icons (table A, table B).
Each sprite is a drag and drop item. Items can be dragged from table A and dropped to a slot on table B, and back again.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Drag and Drop AND Panel Scroll View
« Reply #4 on: May 30, 2013, 12:31:53 AM »
"messed up" is a bit of a vague description. Doesn't the drag & drop example work for you? That's one example. It's very important to let the widget know that its parent has changed after changing its parent -- this is where most people forget to do. If you add something to a table, you also need to call Reposition() on that table for it to update the contents.

jaz1974

  • Guest
Re: Drag and Drop AND Panel Scroll View
« Reply #5 on: September 22, 2013, 08:04:16 PM »
Hi,

Did you manage to resolve this one?
I'm struggling with the same(ish) thing.
I don't suppose there's any chance of someone putting up a short tutorial on how to create a scrolling list of items which can be dragged out of the list and onto the screen?
Would be infinitely grateful.

Cheers!

Jaz