Breaking News
Home / iOS / iOS Snippets / How do you add a colored background in Cocos2d?

How do you add a colored background in Cocos2d?

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];
[pb_builder]

Check Also

EKCalendar – That account does not allow calendars to be added or removed

Usecase When I am trying to create a new Calendar programmatically using the EventKit API …

Advertisment ad adsense adlogger