m_pArmature = CCArmature::create(_strsrc->getCString());
<span style="white-space:pre"> </span>
m_pArmature->getAnimation()->play("Animation1");<span style="white-space:pre"> </span>
m_pArmature->getAnimation()->setMovementEventCallFunc(this,movementEvent_selector(PetLayer::ArmaturePlay));
m_pArmature->getBone("head")->addDisplay(CCSprite::createWithSpriteFrameName("IronWire_1.png"),0);
m_pArmature->getBone("head")->addDisplay(CCSprite::createWithSpriteFrameName("IronWire_2.png"),1);
m_pArmature->getBone("head")->addDisplay(CCSprite::createWithSpriteFrameName("IronWire_3.png"),2);
m_pArmature->getBone("head")->changeDisplayWithIndex(0, true);
或
m_pArmature->getBone("head")->changeDisplayWithIndex(1, true);
或
m_pArmature->getBone("head")->changeDisplayWithIndex(2, true);
this->addChild(m_pArmature);
CCArmature更换骨骼渲染资源
最新推荐文章于 2024-11-13 15:28:39 发布
本文介绍如何使用 Cocos2d-x 播放动画,并为角色头部设置不同的显示图片,包括动画播放的初始化、事件回调设置及头部不同显示状态的切换。
9906

被折叠的 条评论
为什么被折叠?



