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

MouseChildren inconsistent #2102

Closed
MSGhero opened this issue Aug 22, 2017 · 0 comments
Closed

MouseChildren inconsistent #2102

MSGhero opened this issue Aug 22, 2017 · 0 comments

Comments

@MSGhero
Copy link
Member

MSGhero commented Aug 22, 2017

The mouseChildren property within FlxMouseEventManager says that it disallows overlapping objects from receiving mouse events. However, this is only true when those overlapping objects were added to FlxMEM before the object with mouseChildren = false

Example: a sprite group is created and added, with mouseChildren = false. Its children are created and added. Clicking a child will result in both the parent and child receiving callbacks.

Possible solution: this behavior happens due to the unshift() within add(), but changing it to push() wouldn't fix the underlying issue. Perhaps sorting _registeredObjects, with the mouseChildren = false ones coming first, would work. unshift if it's false, push if it's true, and sort/rearrange if setObjectMouseChildren is called.

When two overlapping objects have mouseChildren disabled, it's unclear what should happen.

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

1 participant