Problem
I have created a clipping node with a Sprite using White Image as a Stencil and added Other Sprite Inside Clipping Node to clip it. But I’m having problem hiding stencil outside of the clip.
Here’s an image that show’s the current and expected results.
Clipping Code
// Stencil With White Sprite
auto stencil = Sprite::create("Images/Dummy.png");
stencil->setContentSize(Size(1612+1705, 960));
stencil->setAnchorPoint(Vec2::ZERO);
stencil->setPosition(Vec2(-offset.x - 806, -120));
stencil->setSkewX(40);
this->addChild(stencil);
// Clipping Node
auto clip = ClippingNode::create(stencil);
clip->setAlphaThreshold(0.0f);
this->addChild(clip);
// Sprite Inside Clipping Node That Should Only Show Stencil Overlapping Part
auto dirty_layer = Sprite::create("Images/Part1.png");
dirty_layer->setAnchorPoint(Vec2::ZERO);
dirty_layer->setPosition(offset * -1);
clip->addChild(dirty_layer);
Any help would be appreciated. Thank you in advance.