Blog

cocos2d에서 현재 화면 캡처하는 방법

February 10, 2014

cocos2d에서 현재 화면 캡처하는 방법

게임이 끝나고 iOS 내장된 트위터를 통해서 점수를 보낼 때, 현재 화면을 캡쳐해서 UIImage로 저장하는 방법이다. 


– (void)onShareClicked:(id)sender {

….


 CCRenderTexture* renTxture = [CCRenderTexture renderTextureWithWidth:winsize.width

                                                                height:winsize.height];

  [renTxture begin];

  [self visit];

  [renTxture end];

  

  UIImage *image = [renTxture getUIImage];


}

저작자 표시
비영리
Array