thekayaker33 Posted May 11, 2021 Share Posted May 11, 2021 Is there a way to stop a parent mask from being applied to its children? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 11, 2021 Share Posted May 11, 2021 yes. override `_render()` method, make your own implementation instead of `_renderAdvanced()`, look up those methods in `Container` class sources Quote Link to comment Share on other sites More sharing options...
thekayaker33 Posted May 12, 2021 Author Share Posted May 12, 2021 Yeah that worked, i just changed the renderAdvanced() from if (mask) { renderer.mask.push(this, this._mask); } // add this object to the batch, only rendered if it has a texture. this._render(renderer); // now loop through the children and make sure they get rendered for (let i = 0, j = this.children.length; i < j; i++) { this.children[i].render(renderer); } renderer.batch.flush(); if (mask) { renderer.mask.pop(this); } to if (mask) { renderer.mask.push(this, this._mask); } // add this object to the batch, only rendered if it has a texture. this._render(renderer); // now loop through the children and make sure they get rendered for (let i = 0, j = this.children.length; i < j; i++) { if(this.children[i].ignoreParentMask == null){ this.children[i].render(renderer); } else if(this.children[i].ignoreParentMask == true){ if (mask) { renderer.batch.flush(); renderer.mask.pop(this); this.children[i].render(renderer); renderer.batch.flush(); renderer.mask.push(this, this._mask); } else{ this.children[i].render(renderer); } } else{ this.children[i].render(renderer); } } renderer.batch.flush(); if (mask) { renderer.mask.pop(this); } ivan.popelyshev 1 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.