How to detect direction of drag

I am trying to rotate a group of components clockwise / counterclockwise depending on the direction of a dragged component.

I have a group of 5 components which contains a draggable component. When I drag this component to the right, I want to rotate the group counterclockwise and vice versa, when I drag the component to the left, I want to rotate group clockwise.


Test the value of DragX. While you are dragging, the Dragged message is constantly firing. DragX is the distance of the drag since the previous time Dragged fired.

So if DragX is positive, you are dragging to the right; if negative, to the left. So:

  On Dragged
    if value [[DragX]] is greater than 0
      -- you are dragging to the right
    else if
      -- you are dragging to the left

Thanks for your help Joseph… and speedy response!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.