You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.
Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.
Status = 0
`Check for mouse click/touch
If GetPointerPressed() = 1 And Click = 0
Click = 1 :` There's been a click...
`Record the x and y positions at the start of the swipe.
XClickPos = GetPointerX()
YClickPos = GetPointerY()
`Check for the mouse/touch being released and only if click = 1
If GetPointerReleased() = 1 And Click = 1
`Subtract the current x/y position away from the start positions to get the distance dragged
MovementX = GetPointerX() - XClickPos
MovementY = GetPointerY() - YClickPos
`Get the angle of the drag
DragAngle = ATanFull( MovementX, MovementY )
Click = 0
`We can now use DragAngle and the Movement values to determine how far and in what direction we swiped.
`THis is my drag right to quit code...
If Abs( MovementX ) >= 200 And Abs( MovementY ) <= 20 And DragAngle >= 45 And DragAngle <= 135 Then Status = 9
Login to post a reply