coco2d-x CCDirector.h文件中变量*m_pNotificationNode*
1.在CCDiretor.h中有如下说明
/** This object will be visited after the main scene is visited.
This object MUST implement the "visit" selector.
Useful to hook a notification object, like CCNotifications
(http://github.com/manucorporat/CCNotifications)
@since v0.99.5
*/
CCNode* getNotificationNode();
void setNotificationNode(CCNode *node)
2.在CCDiretor.cpp的成员函数drawScene()
中
// Draw the Scene
void CCDirector::drawScene(void)
{
...
// draw the scene
if (m_pRunningScene)
{
m_pRunningScene->visit();
}
// draw the notifications node
if (m_pNotificationNode)
{
m_pNotificationNode->visit();
}
...
}
这个地方说明了这个节点是一直存在,所以这个可以由大家自由发挥实现各自的用途(对于程序中从开始到结束一直存在的元素的处理都可以放在这里处理)