Hello everyone,
I’m just getting into Phaser and I’m having some problems getting my click events to work. Here’s a simple code example.
export class TestScene extends Phaser.Scene {
preload() {
}
create() {
let g = this.add.zone(0,0,30,30).setInteractive();
g.on(Phaser.Input.Events.GAMEOBJECT_POINTER_DOWN, function() {console.log('Game Object clicked'); this.input.stopPropagation()}, this);
this.input.on(Phaser.Input.Events.POINTER_DOWN, function() {console.log('Screen clicked');}, this);
}
}
I would expect that after the GAMEOBJECT_POINTER_DOWN event was called it would stop the propagation and the POINTER_DOWN event would never fire, but they both are. What is the correct way to only have the higher up event handlers stop the propagation of events?