CCSprite保存效果,以便在xcode for iphone中对更改后的CCSprite执行下一个操作



我在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?


我已经拍到了屏幕截图,但在进行了两次三次镜头效果后,图像似乎很模糊,如果你现在想在镜头效果后保持图像的分辨率不变,请帮忙。

thks提前

您需要使用CCRenderTexture。按此处所述设置(屏幕截图部分),然后调用[img visit]将精灵渲染到渲染纹理上。

最新更新