Android How to detect drag direction?

Discussion in 'Programming' started by Chowderchu, Jan 19, 2018.

  1. Chowderchu

    Chowderchu Guest

    I'm new to mobile development and I'm struggling a bit with the gesture detection.

    Can someone please offer me a simple GML solution for detecting the direction that the player drags their finger, before releasing?

    I don't know how to do it in GML, so right now I am using the DnD Drag Start event, and I also have a Drag End event (please let me know the GML equivalent for these, if you know.)

    The idea is that I would record the starting coordinate for the drag within the Drag Start event, and then I would compare that coordinate with the ending drag coordinate recorded in the Drag End event. The problem is that I don't know how to reference the starting coordinate. Is this handled by mouse_x and mouse_y?

    Thanks in advance for any and all help!
  2. Chowderchu

    Chowderchu Guest

    Looks like I answered my own question regarding the mouse_x, mouse_y (yes, they work for detection of the screen press.)

    However I am still curious what the GML equivalents are for the DnD Global Drag Start and Global Drag End?

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice