Cocos2d-x how to draw in specific free form area

Here https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.h and https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.cpp you can see how a Sprite is being rendering in RenderTexture. What I want to add to this to make visible only the specific part in RenderTexture (canvas). I.e. I should apply a free form mask on it to be able to draw in a specific free form area.

Good application of this is when player colors nails of a character or coloring other parts.

How to do this in cocos2d-x 3.2?

i think clipping node can help you. check out this link,

@smitpatel88 thank you. So I create an object with DrawNode and setStencil that object to the ClippingNode. Nice and easy. Only problem is that it can be an image of a hand, and I need to color only nails. So I need to create 5 shapes with DrawNode to cover the nails. Not very handy, huh?

Why 5 shapes? Just paint the nails into a sprite and use it as a stencil.