pixijs / layers

Separate the z-hierarchy of your scene tree from its canonical structure.
https://pixijs.io/layers/docs/
MIT License
224 stars 57 forks source link

Masking don't work with pixi/layers #103

Open jacobdab opened 1 year ago

jacobdab commented 1 year ago

Hey,

When added @pixi/layers to my project with it breaks all mask that hide what's outside of them:

let layer = window.layer = new Layer(); // happens in init.js
layer.group.enableSort = true;

sprite.parentLayer = layer  // added to function that creates all sprites and containers

const mask = new PIXI.Sprite(PIXI.Texture.WHITE); // example of using code which works without @pixi/layers
    mask.width = serversContainer.width;
    mask.height = serverFrame.height - (serversContainer.y - serverFrame.y) - calculateYMargin(signUpPositions.CHOOSE_SERVER.FRAME_BORDER_SIZE.y);
     serversContainer.addChild(mask);
    serversContainer.mask = mask;

Dependencies versions: "pixi.js": "6.2.2", "@pixi/layers": "1.0.11", "pixi-spine": "^3.0.13",

 EDIT:

Updated to latest and still masking don't work even without @pixi/layers.

What can I do to make it work?