Skip to content

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

Description

@ajex-china

Is it possible to make webgl mask work in animation?

Activity

  1. Matt-Maerz commented on Apr 26, 2022

    @Matt-Maerz

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions