Hi !
Does Cocos2d-x have similar function to DidLoadFromCCB from Cocos2d ? How to handle the state when loading from CCB file has been done ?
You should over ride following four methods:
-
For Menu Selector (if using)
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::CCObject * pTarget, const char * pSelectorName); -
For Control (if using)
virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::CCObject * pTarget, const char * pSelectorName); -
If you have defined any variables in CCB
virtual bool onAssignCCBMemberVariable(cocos2d::CCObject * pTarget, const char * pMemberVariableName, cocos2d::CCNode * pNode); -
This is the one you are looking for. It is called once CCB file is loaded and Scene is created from it.
virtual void onNodeLoaded(cocos2d::CCNode * pNode, cocos2d::extension::CCNodeLoader * pNodeLoader);
Thanks !