How to add duration for input.ondown in phaser? -
how can add duration this.input.ondown()
event in phaser if user clicks 10ms action "a" should happen , if click prolonged action "b" should happen?
if (this.input.activepointer.duration > 10 && this.input.activepointer.duration < 25) { // action "a" } else if (this.input.activepointer.duration > 25) { // action "b" }
put inside update()
or wrap in function call there. should work last active pointer if have multiple (e.g. on mobile).
Comments
Post a Comment