I am trying to create a render texture using all the children of a layer, and then fade that texture out. However when I visit() each child node the end result is not what is seen on screen, it is as if the texture is capturing some ways down and right.
I have tried moving the layer before visiting, along with the render texture and same with changing the anchor points but the render texture always comes out the same. Am I doing something wrong or missing something? Using cocos2dx 2.2.5 through Marmalade.
The simplest solution to solve this is by adding RenderTexture instance itself as a node to the Scene/Layer after your done with it and setting its position to wherever you want:
auto rt = RenderTexture::create(visible Size.width, visibleSize.height);
rt->setPosition(x, y);//set the position to wherever you want and it won't offset
rt->begin();
// some code
rt->end();
addChild(rt);