Jump to content

phaser button event dispatch


Recommended Posts


I am new to phaser development and I have a simple but annoying problem. I am working with VS2015 and typescript and have created a base cordova "app". I added a button in phaser like this

     // i add the button to my main menu 

this.buttonAudio = this.add.button(this.world.width - 20, 20, 'button-audio', this.clickAudio, this);

and also the simplest callback possible

// simplest callback

        clickAudio() {
            console.log('onclick audio');

when I run the code in the ripple emulator and click the button I always get "two" clicks, no matter what I try. This is somewhat annoying as i wanted to use this button to toggle an audio state and clicking it twice all the time leads to no "change".

I am using phaser 2.6.2. I tried lots of different variations, but get always the same result. Anybody came across the same issue? Of course I can use two buttons to kind of avoid the problem but I cant believe this cant be resolved. Any help/idea what might go on is greatly appreciated.

thanks heaps in advance for any input....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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