cocos2dx保存截屏图片

前端之家收集整理的这篇文章主要介绍了cocos2dx保存截屏图片前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
CCSize size = CCDirector::sharedDirector()->getWinSize(); CCRenderTexture *screen = CCRenderTexture::create(size.width,size.height); CCScene *scene = CCDirector::sharedDirector()->getRunningScene(); screen->begin(); scene->visit(); screen->end(); screen->saveToFile("MyCurScene.png",kCCImageFormatPNG);

猜你在找的Cocos2d-x相关文章