2012. 8. 24. 18:00
CCNode의 addChild()를 살펴보면
void CCNode::addChild(CCNode *child, int zOrder, int tag)
{
CCAssert( child != NULL, "Argument must be non-nil");
CCAssert( child->m_pParent == NULL, "child already added. It can't be added again");
if( ! m_pChildren )
{
this->childrenAlloc();
}
this->insertChild(child, zOrder);
child->m_nTag = tag;
child->setParent(this);
child->setOrderOfArrival(s_globalOrderOfArrival++);
if( m_bIsRunning )
{
child->onEnter();
child->onEnterTransitionDidFinish();
}
}
child노드의 onEnter()를 호출한다.
'Cocos2d' 카테고리의 다른 글
cocos2d-x "color type 6" (0) | 2012.08.29 |
---|---|
cocos2d-x CCTextureCache::sharedTextureCache()->textureForKey() (0) | 2012.08.28 |
cocos2d-x HelloWorld 실행시 오류 (1) | 2012.08.24 |
cocos2d-x sharedDispatcher()대신 sharedDirector()->getTouchDispatcher() (0) | 2012.08.21 |
cocos2d-x schedule 관리 (0) | 2012.08.16 |