Jump to content

Unexpected button behaviour


cruzlutor
 Share

Recommended Posts

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

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

 

Link to comment
Share on other sites

  • 4 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...