Hi,
I’m sure that I’m doing something wrong but I can misure a terrible frame rate drop down during animations.
I’m developing a kid game, a king of puzzle game, using cocos2d-x 2.1.4 and I choose Spine to insert into scene little animations.
Than I can misure a rapid decrease of frame rate… that I thought that I was going wrong with my animation so I inserted the spineboy animation (and the code) in place of mine but nothing changed.
At start up frame rate is 1/60 but if a wait and 20 sec it starts to decrease and after 30 sec it become 1/25 and after other 30 sec it become 1/16.
The same happes also if i comment setMix, setAnimation and addAnimation, the CCSkeletonAnimation is freezed, obviously, but the frame rate start to drop down.
If I remove from scene the CCSkeletonAnimation the frame rate is fixed at 1/60.
Please help me… here my code
bool SplashLayer::init(){
MYLOG("start");
MYLOG("COSTRUCTOR SplashLayer");
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
skeletonNode = cocos2d::extension::CCSkeletonAnimation::createWithFile("animations/spineboy.json", "animations/spineboy.atlas");
/*
skeletonNode->setMix("walk", "jump", 0.2f);
skeletonNode->setMix("jump", "walk", 0.4f);
skeletonNode->setAnimation("walk", false, 0);
skeletonNode->addAnimation("jump", false, 0);
skeletonNode->addAnimation("walk", true, 0);
skeletonNode->addAnimation("jump", true, 4, 0);
*/
skeletonNode->debugBones = true;
skeletonNode->update(0);
skeletonNode->setPosition(ccp(winSize.width / 2, 20));
addChild(skeletonNode);
scheduleUpdate();
MYLOG("exit");
return true;
}
void SplashLayer::update(float time){
CCLayer::update(time);
}