添加多个CCArmature

时间:2023-03-10 06:22:57
添加多个CCArmature
CCArmatureDataManager::sharedArmatureDataManager()->
addArmatureFileInfo("armature\\Cowboy0.png", "armature\\Cowboy0.plist", "armature\\Cowboy.ExportJson"); for (int i = ; i < ; i++)
{
cocos2d::extension::CCArmature *armature = cocos2d::extension::CCArmature::create("Cowboy");
armature->getAnimation()->playWithIndex();
armature->setPosition(ccp(CCDirector::sharedDirector()->getWinSize().width / ,
CCDirector::sharedDirector()->getWinSize().height / ));
armature->setScale(0.2f);
addChild(armature, , i);
} getChildByTag()->setAnchorPoint(ccp(, ));
getChildByTag()->setAnchorPoint(ccp(, ));
getChildByTag()->setAnchorPoint(ccp(, ));
getChildByTag()->setAnchorPoint(ccp(, ));
getChildByTag()->setAnchorPoint(ccp(0.5, 0.5));