CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo(“Ani/Demons/demon/demon0.png”, “Ani/Demons/demon/demon0.plist”, “Ani/Demons/demon/demon.ExportJson”);
CCArmature* demon = CCArmature::create(“demon”);
demon->setPosition( ccp(100, 100) );
this->addChild(demon);
demon->getAnimation()->playByIndex(1);
CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo(“Ani/Heros/hero/hero0.png”, “Ani/Heros/hero/hero0.plist”, “Ani/Heros/hero/hero.ExportJson”);
CCArmature* hero = CCArmature::create(“hero”);
hero->setPosition(ccp(300, 100));
this->addChild(hero);
hero->getAnimation()->playByIndex(6);
this->world = new b2World(b2Vec2(0, 0));
b2BodyDef bodyDef;
bodyDef.type = b2_dynamicBody;
demon->setBody(this->world->CreateBody(&bodyDef));
hero->setBody(this->world->CreateBody(&bodyDef));
效果:
问题:
为什么左下角会出现这么多的碰撞区域,但是我在编辑器中是没有编辑的?是BUG吗,有没有人遇到过,怎么解决