Custom class for Sprite , Doc Root Var in Cocosbuilder and Cocos2dx

Custom class for Sprite , Doc Root Var in Cocosbuilder and Cocos2dx
0.0 0


Someone who knows this to explain me what i am doing wrong, or this is not possible in cocosbuilder cocos2dx?

I have CCB file with CCNode like this (since i cannot post images),

CCNode - Custom class (PanoController)
DrawerLayer its only holder, of type CCLayer
—rawImage - it is set as Doc root var with name : rawImage
I want to make rawImage to be instance of mySprite , not CCSprite as it is default.

So , The loader is like this for mySprite,

#include “mySprite.h”

class mySpriteLoader : public CCSpriteLoader{


also the mySprite.h is this ,

#include “cocos2d.h”
#include “cocos-ext.h”

using namespace cocos2d;
using namespace extension;

class mySprite : public CCSprite, public CCBMemberVariableAssigner {

bool onAssignCCBMemberVariable(CCObject* pTarget, const char* pMemberVariableName, CCNode* pNode){ return false; };

mySprite(){CCLog(“init mySprite”);};


also i registered the mySprite loader like this,

m_loaderLibrary = CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary();
m_loaderLibrary->registerCCNodeLoader(“mySprite”, mySpriteLoader::loader());

and in the method from the parent CCLayer set Member Assigner

bool PanoController::onAssignCCBMemberVariable(CCObject* pTarget, const char* pMemberVariableName, CCNode* pNode){

CCLOG ("%s panoController Assign",pMemberVariableName);
CCB_MEMBERVARIABLEASSIGNER_GLUE(this, “rawImage”, mySprite*, m_rawImage);


Still it throws error

@ Assertion failed: (m_rawImage), function onAssignCCBMemberVariable, @

Any ideas, please help. Its working fine if its CCSprite , but mySprite not.