public create () {
this.input.on('pointerdown', (pointer: any) => {
this.pointerAct = 'pointerdown';
this.confirmDoubleClick();
this.longPressSettimeout = setTimeout(() => { // 0.5초간 누를경우 long press 로 인식
}, 500);
});
this.input.on('pointermove', (pointer: any) => {
})
this.input.on('pointerup', (pointer: any) => {
this.pointerAct = 'pointerup';
clearTimeout(this.longPressSettimeout);
})
}
private confirmDoubleClick() {
if (!this.secondClick) { // this.secondClick = false;
this.secondClick = true;
this.time.delayedCall(300, () => { // 300 utime
this.secondClick = false;
});
return false;
}
return true;
}
private handler(shape: any) {
shape.setInteractive({ draggable: true })
.on('dragstart', (pointer: any, dragX: number, dragY: number) => {
this.hanlderStatus = 'dragstart';
this.confirmDoubleClick();
this.longPressSettimeout = setTimeout(() => { // 0.5초간 누를경우 long press 로 인식
if (this.hanlderStatus == 'dragstart' {
console.log(longPress)
}
}, 500);
})
.on('drag', (pointer: any, dragX: number, dragY: number) => {
})
.on('dragend', (pointer: any, dragX: number, dragY: number, dropped: boolean) => {
clearTimeout(this.longPressSettimeout);
this.hanlderStatus = 'dragend';
})
}
private confirmDoubleClick() {
if (!this.secondClick) { // this.secondClick = false;
this.secondClick = true;
this.time.delayedCall(300, () => { // 300 utime
this.secondClick = false;
});
return false;
}
return true;
}