"Cocos2d is an open source 2D game framework. The original Cocos2D framework is written in Python but has since been ported to other languages and platforms. Most notably cocos2d-iphone written in Objective-C targets iOS and Mac OS X. Cocos2D-X is written in C++ and targets mainly iOS, Android and other mobile platforms. There is also cocos2d-iphone-android for Android written in Java, Cocos2d-html5 and cocos2d-javascript for web development and a variety of other, less popular ports.


Cocos2d for iPhone is an Objective-C port for iOS and Mac OS X with the same design and concepts as the original framework. The API comes integrated with Box2D and Chipmunk physics engines. It is used by many games on the App Store." – Wikipedia

Yesterday I encoutered the problem to take a screenshot, I found the solution on the cocos2d forum; it's really simple to solve, you have to write only few lines of code:

 

// Create a UIImage to pass our returned UIImage to

 UIImage *tempImage =[GameScene takeAsUIImage];


// Create paths to output images

NSString  *pngPath = [NSHomeDirectory() StringByAppendingPathComponent:@"Documents/GameImage.png"];

// Write image to PNG

[UIImagePNGRepresentation(tempImage) writeToFile:pngPath atomically:YES];


and nothing more, that's all,

Gg1.