Hello!
I have 2 issues with buttons behaviour
1. If I press the button and move the mouse out of the button when I realease the mouse the action is fired
2. In Desktop, the button action is fired with right and left click but i just need left click, it can be configured?
thanks for your help
Hi, I can halp with issue 1.:
when adding button callback:
button.onInputUp.add(this.upEvent, this);
you can check passed arguments in your handler:
protected upEvent(button: Phaser.Button, pointer: Phaser.Pointer, isOver: boolean): void {
//console.log("Button up");
if (isOver) {
// ... do something ...
}
}
one of the passed arguments is isOver, which says, whether pointer is still over button or not