cocos2dx clippingNode裁剪

cocos2dx clippingNode裁剪,第1张

概述/****************************************************************************/ auto imgNewHead = Sprite::create("moban.png") ; //imgNewHead->setScale(0.5); //auto bg = LayerColor::create(
  /****************************************************************************/    auto imgNewhead = Sprite::create("moban.png") ;    //imgNewhead->setScale(0.5);    //auto bg = Layercolor::create(color4B(255,255,255));    //this->addChild(bg,-1);//1        auto stencil = Sprite::create("paijiuRes/pj_touxiang2.png");    auto clipperNew = ClipPingNode::create();    clipperNew->setStencil(stencil);//设置裁剪模板 //3    clipperNew->setInverted(true);//设置底板可见    clipperNew->setAlphaThreshold(0.5);//设置绘制底板的Alpha值为0        auto content = Sprite::create("diban.png");//被裁剪的内容    clipperNew->addChild(content);//5    clipperNew->setposition(Vec2(stencil->getContentSize().wIDth/2 +200,stencil->getContentSize().height/2 +100));        imgNewhead->setposition(Vec2(stencil->getContentSize().wIDth/2 +200,stencil->getContentSize().height/2 +100));        userheadbg->addChild(imgNewhead);    userheadbg->addChild(clipperNew);        /****************************************************************************/
总结

以上是内存溢出为你收集整理的cocos2dx clippingNode裁剪全部内容,希望文章能够帮你解决cocos2dx clippingNode裁剪所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1085139.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存