Author Topic: drag & drop notification  (Read 4732 times)

wouter

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
    • View Profile
drag & drop notification
« on: May 08, 2014, 11:09:49 AM »
Using the UIDragDropItem Is there a way to be notified when dragging has started in case of restrictions?

Right now I can check if dragging has started using other logic, but since this is not always legal, some functions should only be run when it is "actually" dragged?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: drag & drop notification
« Reply #1 on: May 09, 2014, 05:26:20 AM »
OnDragStart?

wouter

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
    • View Profile
Re: drag & drop notification
« Reply #2 on: May 09, 2014, 06:02:28 AM »
I get that, but how do you ONLY send the notification when it has moved horizontally?

onDragStart sends it when scrolling in the panel as well, I only want to be notified when it started dragging horizontally..

I con copy the code you use for that, but maybe there is  a better way?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: drag & drop notification
« Reply #3 on: May 09, 2014, 06:18:34 AM »
For something like that I'd record the position in OnDragStart, then check it in OnDrag (Vector2 delta). When the position has moved adequately far enough, I'd actually trigger the callback I want to be notified of this.

Basically don't rely on OnDragStart for this. Write some very simple logic instead.