make CCBAnimationManager::getSequenceId public; add method CCBAnimationManager::getSequenceDuration to get duration of timeline;

This commit is contained in:
tianTian 2013-08-05 10:23:41 +08:00
parent 1aadf55b59
commit 77d6692fed
2 changed files with 14 additions and 1 deletions

View File

@ -262,6 +262,14 @@ CCBSequence* CCBAnimationManager::getSequence(int nSequenceId)
return NULL;
}
float CCBAnimationManager::getSequenceDuration(const char *pSequenceName)
{
int id = getSequenceId(pSequenceName);
if (id != -1)
return getSequence(id)->getDuration();
return 0;
}
void CCBAnimationManager::moveAnimationsFromNode(Node* fromNode, Node* toNode) {

View File

@ -87,10 +87,15 @@ public:
Object* actionForCallbackChannel(CCBSequenceProperty* channel);
Object* actionForSoundChannel(CCBSequenceProperty* channel);
// return -1 if timeline not exsit
int getSequenceId(const char* pSequenceName);
// get timeline duration
float getSequenceDuration(const char* pSequenceName);
private:
Object* getBaseValue(Node *pNode, const char* propName);
int getSequenceId(const char* pSequenceName);
CCBSequence* getSequence(int nSequenceId);
ActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *propName, Node *pNode);
void setAnimatedProperty(const char *propName, Node *pNode, Object *pValue, float fTweenDuraion);