Quantcast
Channel: Developer Feed - Snippet
Viewing all articles
Browse latest Browse all 178

How do you add a colored background in Cocos2d?

$
0
0

Adding colored background to a layer is very easy, just create a CCLayer from the subclass CCLayerColor and in the constructor define the name of the color as show below.

  1. // Set background color to magenta.
  2. CCLayerColor* colorLayer =[CCLayerColor layerWithColor:ccc4(255, 0, 255, 255)];
  3. [self addChild:colorLayer z:0];

Viewing all articles
Browse latest Browse all 178

Trending Articles