http://stackoverflow.com/questions/35322773/how-to-blend-two-drawnodes-in-cocos2d
need some help with cocos2d DrawNodes blending. I have DrawNode with sprite on it:
And another DrawNode with drawn polygon (polygon area is less than heart sprite). As a result of blending I need to have only a part of heart sprite inside polygon, like this: My code: TextureNode.h
0
|
It seems that you want to clip the heart sprite using the polygon as a stencil. In that case. You don't have to blend two
DrawNode . Instead, You can use ClippingNode like:
For more
ClippingNode examples, you can refer to the official sample code:https://github.com/cocos2d/cocos2d-x/tree/v3/tests/cpp-tests/Classes/ClippingNodeTest |
沒有留言:
張貼留言