CCClippingNode * Clipper = CCClippingNode::create();
Clipper->setInverted(true);//设置底板可见
Clipper->setAlphaThreshold( 0 );//设置绘制模板的alpha值为0
this->addChild(Clipper);
CCNode * Stencil = CCNode::create();//模板
Clipper->setStencil( Stencil );//设置模板
//添加底片,要被打穿
CCSprite *target = CCSprite::create("");
Clipper->addChild(target);
//添加效果图片,要被打穿
CCSprite * holdbg = CCSprite::create("");
Clipper->addChild(holdbg);
//添加弹孔到模版上,造成底片和效果图片裁剪洞口形状
CCSprite * holdbg = CCSprite::create("");
Stencil->addChild(holdbg);
ClippingNode裁切节点
最新推荐文章于 2021-10-09 09:59:50 发布