Comments (9)
Oh, now i know whats wrong and i think i can reproduce it. thank you!
from layers.
you should add mask to stage too, there are no guarantees for stage-less masks.
It should work, need complete example
from layers.
Thanks for the swift response, Ivan.
Yes, when I added it directly to the stage it worked,
But if the display object used as a mask is added to a Container that is rendered on a specific layer, the above-mentioned problem happened. That was the case with my initial implementation.
const stage = new display.Stage();
const group = new Group(0, true);
const layer = new Layer(group);
stage.addChild(layer);
const container = new Container(); // The container has some children inside, 1 of which will be used as a mask.
container.parentGroup = group;
layer.mask = container.children[0];
from layers.
You are welcome. @ivanpopelyshev
Since I guess it could take a while before the eventual fix is added, can you share where the issue is so I can try a temp solution from my end ?
from layers.
most possibly something with if (this._activeParentLayer)
. It should be ignored if element is a mask
from layers.
@gsotirov actually, if your layer has only dynamic objects - they wont affect bounds, and bounds are required for sprite masks. You may add filterArea to that layer, like layer.filterArea = renderer.screen
, or override calculateBounds
or add a graphics with a rect that has alpha=0.
Please confirm that was the issue!
from layers.
Here's important notice for you: https://github.com/pixijs/layers#important-notice-about-filters-and-masks
from layers.
Nope, I failed to reproduce your case. Can you please put it on jsfiddle or pixi-playground or codesandbox?
from layers.
Thanks @ivanpopelyshev, for the notice.
Sorry for the late response, I've been busy.
While making the example, I was able to make it work, but only if the mask is rendered on the same layer I wanted to mask with it. If I want to use the mask to mask two layers, it won't work.
Here's what I did: https://codesandbox.io/s/pixi-playground-forked-8lwo1?file=/src/index.js
Comment/Uncomment lines 49 & 50 to reproduce.
from layers.
Related Issues (20)
- A bit confused about how to use HOT 3
- PIXI Events propagation bug with zOrder HOT 2
- Z-Index change has no effect HOT 1
- Masking don't work with pixi/layers
- Bug: PIXI Events not respecting zOrder hierarchy of PIXI Layers plugin HOT 2
- Uncaught TypeError: renderer.incDisplayOrder is not a function HOT 6
- updates for pixi v8
- Objects disappear when setting clearing parentGroup/parentLayer
- TS error: Can't assign Layer to Container HOT 4
- Uncaught TypeError: this.applyRenderMixing is not a function HOT 4
- Calling InteractionManager.hitTest throws an exception HOT 3
- I've read through all the documentation / examples and still don't understand how to use this plugin. HOT 13
- how to use webpack pixi-layers HOT 3
- Renderer mixin not applied properly
- How to Set a Clear Colour
- Examples are not working
- After upgrade to v1.0.11, compile to commonjs modules no longer possible in tsConfig HOT 3
- No output with webworkers HOT 1
- support @pixi/events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from layers.