cocos2dx ClippingNode实现stencil效果

前端之家收集整理的这篇文章主要介绍了cocos2dx ClippingNode实现stencil效果前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
auto sp1 = Sprite::create("xukong/pictures/bg102.png"); sp1->setPosition(360,225*2); addChild(sp1); auto sp = Sprite::create("xukong/pictures/bg102.png"); sp->setPosition(230,225); auto m_pClipper = ClippingNode::create(); m_pClipper->setPosition(360-230,225); m_pClipper->setStencil(sp); m_pClipper->setAlphaThreshold(0.0f); this->addChild(m_pClipper); auto cl = LayerColor::create(Color4B(0,150)); m_pClipper->addChild(cl); 原文链接:https://www.f2er.com/cocos2dx/339434.html

猜你在找的Cocos2d-x相关文章