CCNode* node = parent->getChildByTag(1); if (node) { // Do something with node }
CCNode* node = getChildByTag(2); if (node) { // Do something with node }This example shows how to access a child node with tag 2 directly from the current node. The method is called without specifying a parent node, which means it searches for the child node within the current node's children array. Package library: Cocos2d-x.