8,325
社区成员




const std::string yellowCat = "yellow";// 范例,你替换的皮肤名称
CCDictElement *ele = NULL;
CCDICT_FOREACH(dic, ele) {
CCBone *bone = (CCBone*)(ele->getObject());
std::string bonename = bone->getName();
bonename.replace(0, 3, yellowCat);
bonename.append(".png");
CCSkin *skin = CCSkin::createWithSpriteFrameName(bonename.c_str());
int index = bone->getDisplayManager()->getCurrentDisplayIndex();
bone->addDisplay(skin, index);
bone->changeDisplayWithIndex(index, true);
}