カメラをセットアップし、カメラの上に Cocos2d レイヤーを追加することができました。今度は、カメラとカメラの上のレイヤーの画像を含むビュー全体のスクリーンショットを撮りたいと思います。
私の CCLayer は透明にされているので、カメラを通して見ることができます。
これを行う方法に関するアイデア/リンク/詳細.. ?
お時間をいただきありがとうございます:)
編集:これはスクリーンショットの私のコードです
UIGraphicsBeginImageContext([CCDirector sharedDirector].openGLView.superview.frame.size);
[[CCDirector sharedDirector].openGLView.superview.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndPDFContext();
CGRect rect;
rect = CGRectMake(0, 0, 480, 320);
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage],[CCDirector sharedDirector].openGLView.superview.frame);
UIImage * img =[UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
UIImageWriteToSavedPhotosAlbum(img, nil, nil, nil);