Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple click event firing #66

Open
mourice opened this issue Feb 6, 2017 · 6 comments
Open

Multiple click event firing #66

mourice opened this issue Feb 6, 2017 · 6 comments

Comments

@mourice
Copy link

mourice commented Feb 6, 2017

Hi I try to use Ezgui to show popup in my new game using phaserjs. Its really nice thanks for a nice popin effects.
I have a phaser level screen when I click on any level popup comes up. What I am doing is on a click of phaser button I am registering a click event for play button which is a part of popup. But when I click play button of popup the play event fires 3 times. I trited to use off('click') but its also not working getting undefined.
Any suggestions on how to handle this?

@glaucomorais
Copy link

glaucomorais commented Nov 22, 2017

In my case he fires twice.

@glaucomorais
Copy link

Ok.

I found an interesting fact: when the button is inside a Window component, the click callback is called one time by the window context and one time for the button context.

Phaser: 2.6.2
EZGUI: 0.3.3 beta

@glaucomorais
Copy link

A brief update:
In my case when I have a unique button inside a Window, the click event is triggered twitce.

@glaucomorais
Copy link

Another update:
Only the last children button has the click event triggered twice.

@mourice
Copy link
Author

mourice commented Nov 22, 2017

I have solution for this. I didn’t remember it right now but I will post an ans in a day for sure

@glaucomorais
Copy link

I actually added a extra button and set the position to be off-screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants