Jump to content

phaser button event dispatch


telecontrol
 Share

Recommended Posts

Hi,

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

 Share

  • Recently Browsing   0 members

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