After I capture the screen with:
auto renderTexture = RenderTexture::create(width, height,Texture2D::PixelFormat::RGBA8888, GL_DEPTH24_STENCIL8_OES);
Scene* curScene = Director::getInstance()->getRunningScene();
renderTexture->begin();
curScene->visit();
Director::getInstance()->getRenderer()->render();
renderTexture->end();
The images and texts in the scrollview which are outside of the screen are lost like this: 1. normal image The bottom is outside of the screen
The engine would culling the sprite out of screen(at function Sprite::draw
) to get higher performance. You can either close it by modifying the macro CC_USE_CULLING
(at file cocos/base/ccConfig.h
, or you can move the objects in the screen when you capture the screen and move them back after render finish.