cruzlutor Posted May 10, 2016 Share Posted May 10, 2016 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 Link to comment Share on other sites More sharing options...
Tom Atom Posted May 10, 2016 Share Posted May 10, 2016 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 mcolman and cruzlutor 2 Link to comment Share on other sites More sharing options...
cruzlutor Posted May 10, 2016 Author Share Posted May 10, 2016 @Tom Atom, thanks, I think that I can create extend phaser button class and add isOver condition as default, works well Link to comment Share on other sites More sharing options...
mcolman Posted June 1, 2016 Share Posted June 1, 2016 perfect thanks! Link to comment Share on other sites More sharing options...
Recommended Posts