jakubdev Posted September 15, 2022 Share Posted September 15, 2022 Hey, 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; accountsContainer.addChild(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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 15, 2022 Share Posted September 15, 2022 do you know how "accountContainer.height" is calculated? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.