Cocos2d Archives

Updating labels in cocos2d

How to convert a UIView into a UIImage

To convert uiview into a uiimage ..You can use the following code.

 

 

How to add email facility in Objective C

To include email facility in your cocos program,you have to add the MessageUI framework in your program.

Then you have to include the following code.

 

 

Multi Touch in Cocos2d

To recieve multi-touch events, you have to activate them. You can do this by adding the following code in your AppDelegate’s applicationDidFinishLaunching:

To reverse all actions

Almost all actions have the reverse method implemented. Basically it creates a new action with the reverse behavior.

Example:

The move_reverse action will be a CCMoveBy action of duration 2, but with the position value of ccp(-80,-80).

To pause/resume all actions

Incoming search terms:

  • cocos2d-x action pause

CCSpawn action in Cocos2d

The CCSpawn action lets you run several actions at the same time. The duration of the CCSpawn action will be the duration of the longest sub-action.

Speed Actions in Cocos2d

The CCSpeed action modifies the duration of the inner action.

difference between @synthesize and @dynamic

@synthesize will generate getter and setter methods for your property. @dynamic just tells the compiler that the getter and setter methods are implemented not by the class itself but somewhere else (like the superclass)

Uses for @dynamic are e.g. with subclasses of NSManagedObject (CoreData) or when you want to create an outlet for a property defined by a superclass that was not defined as an outlet:

Super class:

Subclass:

Incoming search terms:

  • distinguish between synthasize & dynamic in ios

CallFuncN and CallFuncND Actions

There are two variations of CCCallFunc. They are CCCallFuncN and CCCallFuncND.

CCCallFuncN takes the node as an argument, and CCCallFuncND takes the node and a pointer to some data.

For example:

Page 19 of 42« First...10...1718192021...3040...Last »