void AnimationHandler::generateAnimations(std::vector<AnimationDescriptor*> animationList) { CCLOG("AnimationHandler::generateAnimations initialized"); CCLOG("=Generating animations objects."); int animCount = animationList.size(); Vector<SpriteFrame*>* vectorBuffer = new Vector<SpriteFrame*>[animCount]; for(int c = 0; c < animCount;c++) { auto elem = animationList.at(c); std::string pattern = elem->getPattern(); int frameCount = elem->getFrameCount(); float speed = elem->getAnimationSpeed() == 0? DEFAULT_SPEED : elem->getAnimationSpeed(); std::string status = elem->getStatus(); this->loadFrameBuffer(vectorBuffer[c], frameCount, pattern); _animations.push_back(Animation::createWithSpriteFrames(vectorBuffer[c], speed)); _actions[status] = generateAction(elem, _animations.at(c)); _actions[status]->retain(); } delete[] vectorBuffer; CCLOG("AnimationHandler::generateAnimations done."); }
void Label::animationStart() { // Animation start if(getAnimation()) { // Stop animationStop(); setAnimatonValue(getAnimationValue() + getAnimationSpeed()); } }