Using CCBI inside another CCBI

Hi,

I find that it is possible to use a CCBI file inside another CCBI. I am trying to do that. Also my component CCBI should be repeating/looping its animation.

But the component CCBI stopped animation after the second time. I mean it is coming as a part of main CCBI, but not doing its own animation.

Why is this happening?

I hope I made myself clear, thanks for any help.

Edit : both my main ccbi and sub ccbi are having same custom class.

I am having lots of pail with CCBI inside CCBI too.

To simplify the problem I have created a single CCBI but I cannot access to CCBAnimationManager so I cannot control the animation sequences in anyway.

http://www.cocos2d-x.org/boards/6/topics/34277

I have lost 6 hours to get rid of this problem without success!

Well,

I have solved my issue. The problem was that when onNodeLoaded is called the CCNode tree has been built but the animation managers were not yet initialized.

So right now I can choose which animation to run.

I use one CCBI with one CCBI inside (like your case).
The animations loops without problems.

Did you “chain” the animation in order to loop it (the option is in cocosbuilder at the bottom of the window “chained timeline” ?

Bye

Hi,

Yeah, I have selected “Loop” in cocosbuilder.

Still sub ccbi is not looping. It loops in cocosbuilder, but not in my app.

However, I’ve managed to make it work. In main ccbi AnimationCompletedCallback method i called CCBAnimationManager->runAnimation for sub ccbi. :slight_smile:

But it wont help always.

i meet the same problem , can you show me the finally solution? :frowning:

i meet the same problem , can you show me the finally solution? :frowning:

I encountered similar problem, and found that it is working right in cocos2d, and it turns out the reason is that AnimationManager from main CCB has stopped the action created by sub CCB’s AnimationManager. In cocos2d, it added a property called animationManagerId, which is unique, each action is tagged by its own AnimationManager and will only be stopped by it own AnimationManager.