Jump to content

Pixi mask don't work


Recommended Posts



I use few mask in my game. Most of them work fine. They hide what I want and show what only stuff inside mask, but for some reason one mask is diffrent. She use same code, but doesn't hide what's outside of her.

Code used to make mask work:

    const accountsContainer = createContainer('accountsContainer', true, true, true); // containerName, making Window object, make it container fullscreen, interactive
    setSpriteXYLocation(accountsContainer, signUpPositions.CHOOSE_ACCOUNT.ACCOUNTS.START); // as name suggest set in this case container to certain position on viewport
    let availableAccounts = await getUserAccounts(user._id); // fetch accounts

    renderAccountFrame(commonSH, signUpSH, accountsContainer, availableAccounts); // render list of accounts

    const mask = new PIXI.Sprite(PIXI.Texture.WHITE);
    mask.width = accountsContainer.width;
    mask.height = accountsContainer.height;
    accountsContainer.mask = mask;


First video show how this mask behave, when not attached to in this case accountsContainer with code `accountsContainer.mask = mask;`
Second video has mask attached to its container.




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...