[cocos2dx] Add missing new AnimationState methods. Closes #807

This commit is contained in:
badlogic 2016-12-20 10:45:24 +01:00
parent 303b7b8c74
commit b9ee3bfc5d
2 changed files with 15 additions and 0 deletions

View File

@ -170,6 +170,18 @@ spTrackEntry* SkeletonAnimation::addAnimation (int trackIndex, const std::string
return spAnimationState_addAnimation(_state, trackIndex, animation, loop, delay);
}
spTrackEntry* SkeletonAnimation::setEmptyAnimation (int trackIndex, float mixDuration) {
return spAnimationState_setEmptyAnimation(_state, trackIndex, mixDuration);
}
void SkeletonAnimation::setEmptyAnimations (float mixDuration) {
spAnimationState_setEmptyAnimations(_state, mixDuration);
}
spTrackEntry* SkeletonAnimation::addEmptyAnimation (int trackIndex, float mixDuration, float delay) {
return spAnimationState_addEmptyAnimation(_state, trackIndex, mixDuration, delay);
}
spAnimation* SkeletonAnimation::findAnimation(const std::string& name) const {
return spSkeletonData_findAnimation(_skeleton->data, name.c_str());
}

View File

@ -73,6 +73,9 @@ public:
spTrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop);
spTrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0);
spTrackEntry* setEmptyAnimation (int trackIndex, float mixDuration);
void setEmptyAnimations (float mixDuration);
spTrackEntry* addEmptyAnimation (int trackIndex, float mixDuration, float delay = 0);
spAnimation* findAnimation(const std::string& name) const;
spTrackEntry* getCurrent (int trackIndex = 0);
void clearTracks ();