Zohaib Zaidi wrote:
How do I change the background color using cocos2dx and airplay. I tried using CCLayer::initWithColor but in cocos2dx initWithColor is a member of CCLayerColor so I tried CCLayerColor::initWithColor but it says it can not be called without a calling object.
Any ideas ?
I am very new with cocos2dx and also with c++ and I have started with the helloword sample game. I am trying to change the background,
But, I am also facing same issue.
In my project,
I have changed
class HelloWorld : public cocos2d::CCLayer
class HelloWorld : public cocos2d::CCLayerColor
& if ( !CCLayer::init())
if ( !CCLayerColor::initWithColor(ccc4(0, 0, 255, 255)))
but getting error as follows:
Invalid arguments ‘
bool initWithColor(const cocos2d::_ccColor4B &, ?, ?)
bool initWithColor(const cocos2d::_ccColor4B &)
The type ‘HelloWorld’ must implement the inherited pure virtual method ‘cocos2d::CCRGBAProtocol::setOpacity’
Please help me to solve this issue.