Author Topic: Issues on achieving the desired dragging behaviour  (Read 8062 times)

Antares88

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 35
    • View Profile
Issues on achieving the desired dragging behaviour
« on: September 06, 2013, 05:42:45 AM »
Hello,
I have a panel containing multiple instances of the same item.
I'm trying to achieve the following behaviour:
- when the user taps on an item and drags it horizontally, all the other items are moved horizontally with him.
- when the user taps on an item and drags it vertically, only that single item is moved vertically.

Something similar could be achieved attaching to each item two UIDragObject.
The first one is for horizontally dragging, therefore its dragging target is the panel containing all the items and the movement is locked on the horizontal axis.
The second one is for vertically dragging, therefore its dragging target is the item itself and the movement is locked on the vertical axis.

This solution seems quite dirty to me, and also has the side effect that it is possible to move the item horizontally and vertically at the same time (a.k.a. diagonal movement :D) while I would like that the item is movable on one axis at time.

Any idea ?

Thanks

Antonio

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issues on achieving the desired dragging behaviour
« Reply #1 on: September 07, 2013, 12:41:05 AM »
Best thing to do is to write your own custom component for this. You need custom behaviour, so write a custom script.