我已经在CCsprite上执行了CCLens3D效果,我必须将CCSprite保存到png。请帮我 我使用了以下代码
@implementation HelloWorldLayer
CCSprite *img;
-(void)lensEffect:(CGPoint )touchpoint
{
const CGSize size = [[CCDirector sharedDirector] winSize];
NSLog(@"%f",touchpoint.x);
// const CGSize size = [[CCDirector sharedDirector] winSize];
id lens = [CCLens3D actionWithPosition:CGPointMake(touchpoint.x,touchpoint.y)
radius:50.f
grid:ccg(20.f,20.f)
duration:0.f];
[img runAction:lens];
}
[img runAction:lens]之后 我必须用行动保存img吗?
我有屏幕截图但是在执行了两次三次镜头效果后,图像看起来很模糊请帮助你现在如何在镜头效果后保持图像分辨率相同。
事先知道答案 0 :(得分:0)
您需要使用CCRenderTexture。 Set it up as described here(截图部分),然后调用[img visit]将精灵渲染到渲染纹理上。