Is it possible to make webgl mask work in animation?
ajex-china opened this issue · comments
ajex commented
Is it possible to make webgl mask work in animation?
Matt-Maerz commented
Yes,
- add the mask to the container.
- cache teh container
- call .updateCache() from the container on every change.
Example:
let maskContainer = new createjs.Container();
...
let mask = new createjs.Shape();
mask.graphics.drawRect(0,0, sizeX, sizeY);
maskContainer.mask = mask;
....
maskContainer.addChild(scrollcontentContainer);
....
maskContainer.cache( 0, 0, sizeX, sizeY);
...
//On every change
maskContainer.updateCache();