2 Comments for this entry

  • Saurabh

    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.

  • aeonphyxius

    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 🙂

Leave a Reply