In older version ,
I use to write it with this way
CCNode* bg = CCBReader::nodeGraphFromFileOwner(“bg.ccb”,“”,this);
addChild(bg,0);
Now the same thing in new version which is inside the extension folder
CCNodeLoaderLibrary * ccNodeLoaderLibrary = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
cocos2d::extension::CCBReader * ccbReader = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary);
CCNode * node = ccbReader->readNodeGraphFromFile(“”, “bg.ccb”, this);
It is not working ? What mistake is happening while initialising ?
I’m trying the same thing, the node returned is null and there is no error message in the traces.
Note that I’m not sure the new CCBReader supports .ccb format, it seems that now it supports .ccbi format.
As far as I’m concerned the problem I have is a bad access because I have a CCMenuItemImage in my ccb node. Maybe there’s a pb with CCMenuItemImage, I’ll try to remove them.
I can’t add a CCControlButton in cocosBuilder v2.0 RC1. If I add it, cocos2d-2.0-rc2-x-2.0.1 will be have a Assertion failed when it load a ccbi file.
CCNodeLoader.cpp line:748 Expression:false