Capture of a specific node

I would like to capture a specific node. With RenderTexture, a whole screen is captured.

var renderTexture = new cc.RenderTexture(nodeWidth, nodeHeight);
renderTexture.begin();
cc.director.getRunningScene().visit(); // (a)
renderTexture.end();

At (a) line, Can I visit a node instead of a running scene?
If not, is there any alternative?

simply visit node which you capture instead cc.director.getRunningScene().

ex : nodeName.visit();

Thanks for the reply.

But node.visit() produces following error:

Sorry, cc.Node.visit is removed.
Uncaught TypeError: this.node.visit is not a function

Cocos Creator is v1.5.0 and RenderMode is canvas.

you should call cc.director.getRunningScene()._sgNode.visit(), Cocos Creator actually have two separate tree:

logic tree: it’s the entity tree. Creator is component based architecture, each entity has a related sgNode and each rendering component also has a sgNode. The sgNode is explained in the following section.

render tree: the render tree is the original cocos2d-html5 node tree, each node is also know as a sgNode .

Thanks owen,

I tried node._sgNode.visit() and it captures sprites, but can’t capture cc.Graphics.

I would like to capture a node having cc.Graphics component which handles user’s drawing (moveTo, lineTo etc.).