I normally use TouchX and TouchY, this is handled by HTML5 and converted to mouse. Have you tried this way round? It might fix your problem - it should register the x and y as soon as you touch the screen. The code below has not been tested but it should work (ive used similar).
If TouchHit()
If PointInsideRect( TouchX(), TouchY(), x1, y1, x2, y2 )
'do stuff
endif
endif
Function PointInsideRect : bool( px : float, py : float, x1 : float, y1 : float, x2 : float, y2 : float )
if px > x1 and py < x2
if py > y1 and py < y2
return True
endif
endif
return False
end function
|