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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -