Susitha
Susitha

Reputation: 3349

How to run several cocos builder animations in a sequence

I have multiple animations that created using cocosbuilder. They are in different time lines. I can run animation by using,

  [animationManager runAnimationsForSequenceNamed:@"Walking"];

How can i run second animation after first one ended. Is there a way to run multiple animations in asequence.

Upvotes: 0

Views: 276

Answers (1)

Nico
Nico

Reputation: 1838

It should be concerned to "CocosBuilder + CCBReader", however, if you are using 2.1 version you can change the "sequenceCompleted" method of CCBAnimationManager to the following:

- (void) sequenceCompleted
{
    NSString *completedSequenceName = [runningSequence.name copy];
    int nextSeqId = runningSequence.chainedSequenceId;
    runningSequence = NULL;

    if (nextSeqId != -1)
    {
        [self runAnimationsForSequenceId:nextSeqId tweenDuration:0];
    }

    [delegate completedAnimationSequenceNamed:completedSequenceName];
    [completedSequenceName release];
}

Use this code it could help you.

This link seems useful for you.

https://github.com/cocos2d/CocosBuilder/issues/121

Upvotes: 1

Related Questions