Detect click event anywhere on canvas?

Hi all,

I’ve been using this syntax to handle click events:
btn.on(‘pointerdown’, this.callBack, this)

But can’t figure out how to set up a click event that fires when user clicks anywhere on the canvas.

Much appreciated!

1 Like

This should do what you need:

this.input.on('pointerdown', () => console.log('click'));
4 Likes