gammafp

Members
  • Content Count

    6
  • Joined

  • Last visited

Posts posted by gammafp


  1. 7 hours ago, prob said:
    
    var downX, upX, downY, upY, threshold = 50;
    
    target.on('pointerdown', function (pointer) {
    	downX = pointer.x;
    	downY = pointer.y;
    };   
    
    target.on('pointerup', function (pointer) {
    	upX = pointer.x;
    	upY = pointer.y;
    	if (upX < downX - threshold){
    		console.log("swipeleft");
    	} else if (upX > downX + threshold) {
    		console.log("swiperight");
    	} else if (upY < downY - threshold) {
    		console.log("swipeup");
    	} else if (upY > downY + threshold) {
    		console.log("swipedown");
    	}
    };      

     

    Yes, this is correct. Thanks you for you aswer.