http://www.raywenderlich.com/4666/how-to-create-a-hud-layer-with-cocos2d
i wan’t to create a hud just like in this tutorial but i’m having trouble with the LAYER_NODE_FUNC macro.
if i change my init method the macro messes up since the parameter list is no longer 0. i tried defining my own node method
CCLayer CCLayer::node
{
CCLayerpRet = new CCLayer();
if (pRet && pRet~~>init)
{
pRet~~>autorelease();
return pRet;
}
else
{
CC_SAFE_DELETE(pRet)
return NULL;
}
}
but that doesn’t work either,
1>c:2d-1.0.1-x-0.9.2\game\classes\helloworldscene.cpp(28) : error C2440: ‘initializing’ : cannot convert from ‘cocos2d::CCLayerColor ’ to ’HelloWorld’
1> Cast from base to derived requires dynamic_cast or static_cast
1>c:2d-1.0.1-x-0.9.2\game\classes\helloworldscene.cpp(234) : warning C4273: ‘cocos2d::CCLayer::node’ : inconsistent dll linkage
1> c:2d-1.0.1-x-0.9.2\cocos2dx\include\cclayer.h(53) : see previous definition of ‘node’