by aeonphyxius on Sep.06, 2012, under Cocos2d-x
I want to change the background of the layer i changed the CC_BREAK_IF(!CCLayer::init());
to
CC_BREAK_IF(!CCLayerColor::initWithColor( ccc4(255,255,255,255) ));
and also in .h file
class HelloWorld : public cocos2d::CCLayer to class HelloWorld : public cocos2d::CCLayerLayer
Please help me to solve this.
Are you receiving an error? could you please post it ? Tell me a bit more about it so I can proper follow what you are trying to do 🙂
Right now, what I see is the following:
In the class HellowWorld header (.h) I see this mistake:
HellowWorld : public cocos2d::CCLayerColor
Also to initialize the layer with a background color you can use a different one than white (255,255,255,255)
CC_BREAK_IF(!CCLayerColor::initWithColor( ccc4(100,100,100,100) ));
or try this (without the CC_BREAK_IF macro). CCLayerColor::initWithColor( ccc4(255,255,255,255) );
Let me know if it works 🙂
Name (required)
Mail (will not be published) (required)
Website
Δ
July 12th, 2013 on 2:43 pm
I want to change the background of the layer i changed the
CC_BREAK_IF(!CCLayer::init());
to
CC_BREAK_IF(!CCLayerColor::initWithColor( ccc4(255,255,255,255) ));
and also in .h file
class HelloWorld : public cocos2d::CCLayer
to
class HelloWorld : public cocos2d::CCLayerLayer
Please help me to solve this.
July 12th, 2013 on 3:26 pm
Are you receiving an error? could you please post it ? Tell me a bit more about it so I can proper follow what you are trying to do 🙂
Right now, what I see is the following:
In the class HellowWorld header (.h) I see this mistake:
HellowWorld : public cocos2d::CCLayerColor
Also to initialize the layer with a background color you can use a different one than white (255,255,255,255)
CC_BREAK_IF(!CCLayerColor::initWithColor( ccc4(100,100,100,100) ));
or try this (without the CC_BREAK_IF macro).
CCLayerColor::initWithColor( ccc4(255,255,255,255) );
Let me know if it works 🙂