我正在测试 Cocos2d 2.1 beta4 中添加的新裁剪节点CCClippingNode
。但是,我无法使用以下方法截取剪裁节点的屏幕截图。最终结果是未剪辑的图像。你可以在这里找到新版本:http: //www.cocos2d-iphone.org/download
+ (UIImage *) screenshotNode:(CCNode*)startNode {
[CCDirector sharedDirector].nextDeltaTimeZero = YES;
CGSize winSize = [CCDirector sharedDirector].winSize;
CCRenderTexture * rtx = [CCRenderTexture renderTextureWithWidth:winSize.width height:winSize.height];
[rtx begin];
[startNode visit];
[rtx end];
return [rtx getUIImage];
}