2012-06-21 94 views
0

嗨,我正在使用cocos2d圖像編輯應用程序。當我用cspos2d在ccsprite中執行一些動作時,我使用截取了ccsprite的截圖並保存它以執行下一個效果。 但是在執行每一個動作之後,截圖的圖像變得更加模糊。 我希望始終如一地保持圖像的分辨率,所以如果你有任何想法在每個屏幕截圖後保持分辨率。 如何解決分辨率問題?我如何在xcode中保留coco2d中的UIimage的分辨率?

你可以給我發電子郵件[email protected]

+0

你應該爲你提供使用,使截圖的代碼,這個問題是存在的...... – sergio

回答

0

喜我使用這個代碼採取截圖

+(CCRenderTexture *)screenshotWithStartNode:(CCSprite )的StartNode文件名:(的NSString)文件名 { [CCDirector sharedDirector] .nextDeltaTimeZero = YES;

CGSize winSize = CGSizeMake(startNode.contentSizeInPixels.width, startNode.contentSizeInPixels.height); 

CGSize photoSize =CGSizeMake(startNode.contentSize.width, winSize.height * startNode.scaleX); 
CCRenderTexture* rtx =[CCRenderTexture renderTextureWithWidth:startNode.contentSizeInPixels.width height:startNode.contentSizeInPixels.height]; 
[rtx begin]; 

[startNode visit]; [rtx end];

// save as file as PNG 
[rtx saveBuffer:[self screenshotPathForFile:filename] 
     format:kCCImageFormatPNG]; 

return rtx; 

}

相關問題