[SOLVED] CocosBuilder integration problem

[SOLVED] CocosBuilder integration problem
0.0 0



After loading a ccbi file I want to run a specific animation

void HelloWorldScene::onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader) {
    CCBAnimationManager *man = dynamic_cast( this->getUserObject());

    if (man)
        CCLOG("Animation manager");
    } else CCLOG("NOT Animation manager");

The cast fails so I get “NOT Animation manager” with cocos2d-x 2.1.4 with cocos builder 3.0 alpha5.

Using CCBI inside another CCBI

I have solved my issue.

It all depends on the way ccbreader loads a ccbi and sets the userObject.

The order is:

1- load the node tree
2- call onNodeLoaded method
3- appends the animation managers looping through the nodes

When onNodeLoaded the userObject is not yet set so I get a null dynamic_cast

Hope this info will help.