Author Topic: Drag & Drop example  (Read 2575 times)

hong88

  • Guest
Drag & Drop example
« on: February 28, 2013, 11:48:11 PM »
I use a scroll view (panel) as the background to become my background scene ( use drag to move between scene).
Then I have a inventory bar that I use Drag & Drop example to implement.
The problem is when I drag the item to incorrect place ( no collider & no DragDropSurface.cs), it does not go back to inventory bar.

I thought is background scene collider problem so I disable it to try but still the same:
Item go to last mouse position but parent to my DrapDropContainer.

Actually I quite confused to set the z-position, so i attach a picture how the structure of my scene

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Drag & Drop example
« Reply #1 on: March 01, 2013, 10:15:05 AM »
You missed something. Look closer at the provided example. As I recall the returning of the object is accomplished in an OnPress(false) function.

hong88

  • Guest
Re: Drag & Drop example
« Reply #2 on: March 05, 2013, 03:32:37 AM »
Thanks, you're right. I forgot UITable script and some depth and collider settings.

1 more question, Scroll View with Draggable Panel and Scroll View with Draggable camera which 1 is more suitable for background drag scene ?
Because I have certain "tool" graphic will place on the top of background scene and due to collider is place on top of background scene therefore certain area will not able to drag scene.

I will start to try draggable camera scroll view, by the way i hope any advise would be appreciated.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Drag & Drop example
« Reply #3 on: March 05, 2013, 02:26:31 PM »
Panel is a better choice. Camera approach is for old-school devices (iPhone 3G and lower).