Breaking News
Home / Tag Archives: Cocos2D

Tag Archives: Cocos2D

Coco2d 2x upgrade error – Cannot find protocol declaration

Issue On upgrading to cocos2d 2.x for 1.x, the project fails to compile and the following two errors are displayed: 1) Cannot find protocol declaration for CCTargetTouchDelegate 2) Cannot find protocol declaration for CCStandardTouchDelegate Solution In cocos2d 2.x the delegates class names have been renamed as follows: CCTargetedTouchDelegate -> CCTouchOneByOneDelegate …

Read More »

CCSprite#draw SHOULD NOT be called

Issue Users/mvohra/workspace/projects/iphone/BasketBall/BasketBall/libs/cocos2d/CCSprite.m:5762012-09-13 23:01:43.450 Shoot that Ball[20513:10a03] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘If CCSprite is being rendered by CCSpriteBatchNode, CCSprite#draw SHOULD NOT be called’*** First throw call stack: Resolution This exception happens when you add CCSpriteBatchNode is used to batch up the Sprites but at the same …

Read More »

How to hide the Cocos2D frame rate display?

Cocos2D displays the frame rate i.e. the number of frames per second in the bottom left corner of screen when the scene is rendered. This is a very useful piece of information for debugging purposesbecause it allows you to see the frame rate your game realtime as it runs. The …

Read More »

Understanding Cocos2D CCNode?

/** CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode. The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu.  The main features of a CCNode are: – They can contain other CCNode nodes (addChild, getChildByTag, removeChild, etc) – They can schedule periodic callback (schedule, unschedule, …

Read More »

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. // Set background color to magenta. CCLayerColor* colorLayer = [CCLayerColor layerWithColor:ccc4(255, 0, 255, 255)]; [self addChild:colorLayer z:0]; [pb_builder]

Read More »
Advertisment ad adsense adlogger