* function callback for the pointerdown event * @ignore
(event: Pointer)
| 94 | * @ignore |
| 95 | */ |
| 96 | clicked(event: Pointer): boolean | void { |
| 97 | // Check if left mouse button is pressed |
| 98 | if (event.button === 0 && this.isClickable) { |
| 99 | this.isDirty = true; |
| 100 | this.released = false; |
| 101 | if (this.isHoldable) { |
| 102 | timer.clearTimer(this.holdTimeout); |
| 103 | this.holdTimeout = timer.setTimeout( |
| 104 | () => { |
| 105 | this.hold(); |
| 106 | }, |
| 107 | this.holdThreshold, |
| 108 | false, |
| 109 | ); |
| 110 | this.released = false; |
| 111 | } |
| 112 | if (this.isDraggable) { |
| 113 | this.grabOffset!.set(event.gameX, event.gameY); |
| 114 | this.grabOffset!.sub(this.pos); |
| 115 | } |
| 116 | return this.onClick(event); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * function called when the object is pressed (to be extended) |
no test coverage detected