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

Masks prevent interactions regardless of layers/groups. #17

Closed
namark opened this issue Sep 13, 2017 · 5 comments
Closed

Masks prevent interactions regardless of layers/groups. #17

namark opened this issue Sep 13, 2017 · 5 comments

Comments

@namark
Copy link
Contributor

namark commented Sep 13, 2017

I'm using the layers branch and I've got this very basic setup:

const stage = new PIXI.display.Stage();
stage.group.enableSort = true;

const overlay = new PIXI.display.Group(10, false);
stage.addChild(new PIXI.display.Layer(overlay));

If I set the parentGroup of a display object to overlay it works just fine visually, the object is rendered on top of anything else in the stage, but if the parent of that object has a mask, while still displayed correctly, the interactions don't work unless the object is within the bounds of the mask.

Seems like a pretty nasty problem since the decision is made before even getting to the object that has a parentGroup set
https://github.com/pixijs/pixi-display/blob/25a2a0e06269c6fde4241308a54727bffb9405d2/src/InteractionManagerMixin.ts#L45
so I'm hoping that I just overlooked some easy way around this.

@namark namark changed the title Mask prevent interactions regardless of layers/groups. Masks prevent interactions regardless of layers/groups. Sep 13, 2017
@ivanpopelyshev
Copy link
Collaborator

You are right, that's a bug. Its not easy to make interaction work with this, of course we'll need some adjustments ^_^ Working on it.

@namark
Copy link
Contributor Author

namark commented Sep 13, 2017

Wow, you mean there is hope? Yaaay
Thanks!

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Sep 13, 2017

Ok, lets try new version, I made fast fix but its not complete, it doesnt handle masks of parent layer. Look in "bin" folder of this branch.

@namark
Copy link
Contributor Author

namark commented Sep 14, 2017

Just tried it, seems to be working well for my use case, thanks for the quick fix!

@ivanpopelyshev
Copy link
Collaborator

Ok, i found one more issue with that, and just fixed it. Lets close this issue.

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