Android simulate drag gesture movement

S

Stratos.la

Guest
Hey everyone , as title sais i want to stimulate a drag effect only when the mouse is been held down to move on the x axis. after some trial and error i did it and when testing on windows it works just fine, but when i run it on my phone its not working! Basicaly the code breaks the screen down to left and right and depending on where you tap the player moves. It supports both mouse_press and drag but i want to remove the mouse press so it will move only when there is a difference in mouse_x so i did this:

GML:
var moving = point_distance(mx, my, mouse_x, mouse_y);

// update positions of fake mouse
mx = mouse_x;
my = mouse_y;

// if they are apart
if (moving)
{
if mouse_check_button(mb_any)
    {
        if (mouse_x>360)
        point_dir=point_direction(x,y,mouse_x,1000)-90;
        rot+=sin(degtorad(point_dir - rot))*-rot_spd;
        bouncer=sign(rot);
    }
}
i also declare mx , my on the create event.


now on windows it works just fine i cannot tap on the screen for the player to move, only by dragging the finger. so why doenst it work on my phone??
 
Top