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

Is it possible to make webgl mask work in animation? #1069

Open
ajex-china opened this issue Mar 25, 2022 · 1 comment
Open

Is it possible to make webgl mask work in animation? #1069

ajex-china opened this issue Mar 25, 2022 · 1 comment

Comments

@ajex-china
Copy link

Is it possible to make webgl mask work in animation?

@Matt-Maerz
Copy link

Matt-Maerz commented Apr 26, 2022

Yes,

  1. add the mask to the container.
  2. cache teh container
  3. 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();

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