测试代码很简单:
this.canvas.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMoveCallback, this, true)
onTouchMoveCallback(event:cc.Event.EventTouch) {
let touches = event.getTouches();
if (touches.length >= 2) {
console.error(“双指操作”)
}else{
console.error(“单指操作”)
}
}
结果是两指手指操作的时候,单指操作log也有非常多。
请问这是正常的吗?这样的话,如果有双指操作缩放需求的话,需要做很多防止抖动判定逻辑