【发布时间】:2013-01-12 10:19:43
【问题描述】:
我正在测试 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];
}
【问题讨论】:
-
我想剪辑不适用于渲染纹理。如果您可以在一个简单的测试用例中验证这一点,您应该将其报告为错误。
标签: ios objective-c cocos2d-iphone screenshot