Clipping SpriteBatchNode

Clipping SpriteBatchNode
0.0 0


I tried to clip a SpriteBatchNode using this code:

auto containerSprite = ClippingNode::create(mask);

It’s clipped fine, except the background becomes white, which I don’t want. Is it a correct way to clip a batch node? Or is there another way of doing it?
I’m using cocos2d-x 3.0alpha1

I attached the screenshot

Thanks :slight_smile:

clippingnode.png (58.4 KB)


It seems, the white color is the color of my mask sprite. If I clip just a simple Sprite, the mask/stencil node is not rendered which how it should work.

So is it some kind of a bug in ClippingNode if it takes a SpriteBatchNode as child?


Solved… I was mistakenly adding the batchNode to root node.