If you found the solution why don’t you post about that solution?
I think whether you were helped by this forum or not, it’s your responsibility to end up your thread by answering.
I’m not trying to blame you, I’m just talking about conscience.
Anyway, let’s get back to the original question.
It can be easily done by combining cocos2d-x and cocod2d-iphone.
(Because there’s already exist the function which converts rendered texture to UIImage on the cocos2d-iphone’s CCRenderTexture class)
I made CCRendererTextureEx in that way, and I’ll attache it.
Sample usage below - converting CCSprite to UIImage.
UIImage* UIImageFromCCSprite(CCSprite *sprite)
CCSize size = sprite->getTexture()->getContentSizeInPixels();
CCRenderTextureEx *renderer = CCRenderTextureEx::create(size.width, size.height);
CCPoint originalAnchor = sprite->getAnchorPoint();
renderer->beginWithClear(0, 0, 0, 0);
UIImage *result = renderer->getUIImage();
Please note that you can use this class in .mm file only.
You don’t need UIImage in .cpp file anyway.