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

Buttons states are active. #429

Closed
ankush-badyal opened this issue Jan 5, 2018 · 9 comments
Closed

Buttons states are active. #429

ankush-badyal opened this issue Jan 5, 2018 · 9 comments

Comments

@ankush-badyal
Copy link

On moving mouse out of the canvas, if the mouse was over a button, the button stays in hover state and if we move the mouse back on canvas at other location then the mouse stays in hand cursor and the button stays in hover state, until you move the mouse over the button again and move out on the canvas.

@samme
Copy link
Collaborator

samme commented Jan 8, 2018

@ankush-badyal
Copy link
Author

The example you have created is what i wanted to point at.

squaresun pushed a commit to squaresun/phaser-ce that referenced this issue Jan 15, 2018
@squaresun
Copy link
Contributor

#439

I've made a PR trying to fix this.

@samme
Copy link
Collaborator

samme commented Jan 15, 2018

Could this be solved by adding

input.interactiveItems.callAll('_pointerOutHandler', this);

in Phaser.Pointer#stop?

@squaresun
Copy link
Contributor

squaresun commented Jan 16, 2018

@samme I haven't noticed interactiveItems inside input.
It seems that the Phaser.InputHandler#_pointerOutHandler would be called twice (The mouse goes out of canvas and get back to canvas).

So I put this

this.input.interactiveItems.callAll('_pointerOutHandler', this.input.mousePointer);

in Phaser.Mouse#onMouseOut and it seems ok.

I've updated PR for this. Thanks for the advice.

@samme
Copy link
Collaborator

samme commented Jan 16, 2018

@squaresun can you explain? Thanks.

It seems that the Phaser.InputHandler#_pointerOutHandler would be called twice (The mouse goes out of canvas and get back to canvas).

@squaresun
Copy link
Contributor

@samme
When the mouse goes out of canvas, _pointerOutHandler called. (That sounds normal)
But when the mouse goes into canvas from outside, _pointerOutHandler called again (Which is not expected)

@samme
Copy link
Collaborator

samme commented Jan 16, 2018

That might be OK. I guess I'll have to try it.

@samme
Copy link
Collaborator

samme commented May 8, 2019

I’m going to move this behavior under stopOnGameOut.

samme added a commit that referenced this issue May 10, 2019
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

3 participants