I utilized the code here to create beautiful in game save screenshots for my game. You can check out the source code link here http://www.cocos2d-iphone.org/forum/topic/19086
Cocos2d screenShot
(96 posts) (57 voices)-
Posted 7 months ago #
-
Hi,
I want to make a screenshot of only one layer (of two) which is using only openGL commands for the graphics.
The functions in this thread are not working for cocos2d 1.1 or they are capturing the whole screen with all layer.
Is there any solution for my problem?Posted 5 months ago # -
Hi,
I have just upgraded my app to xcode 4.3.2 and cocos2d 2.0 rc. I was using the following code to take in-game snapshots:
CCDirector *director = [CCDirector sharedDirector];
UIImage *image = [director screenshotUIImage];Now I'm getting the following error message:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CCDirectorDisplayLink screenshotUIImage]: unrecognized selector sent to instance 0xdb294e0'
Any idea on how to fix it?
Thanks in advance
Posted 1 month ago # -
Answering myself:
1- screenshotUIImage is not implemented within CCDirector, not in 2.0, neither in previous versions
2- There have been introduced a few changes within CCDirector in 2.0. For instance, displaySize have dissapeared. This prevented the old code of screenshotUIImage (from @manucorporat) to work as it was designed
3- For my purpose, it has been enough to replace displaySize and winSize in screenshotUIImage for this values:CGSize displaySize = [self winSizeInPixels];
CGSize winSize = [self winSizeInPixels];Posted 1 month ago # -
AWScreenShot works well when multi-sampling is not enabled. But when multisampling is enabled, it gives 0x502 opengl error and screen is not captured. After researching a little bit, it seems to be related to resolving multi-samples buffers - 'glResolveMultisampleFramebufferAPPLE'. But I could not get it to work inside 'takeAsCGImage' method.
Can someone help ?
Thanks,
SimplePosted 1 week ago # -
Yea there really should be an updated method to take screenshots as of Cocos2D 2.0 rc1.
Posted 1 week ago #
Reply
You must log in to post.