本文整理汇总了C++中CCDirector::setNotificationNode方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDirector::setNotificationNode方法的具体用法?C++ CCDirector::setNotificationNode怎么用?C++ CCDirector::setNotificationNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCDirector
的用法示例。
在下文中一共展示了CCDirector::setNotificationNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getClassTypeName
void Cocos2dRenderManager::initialise()
{
CCDirector *pDirector = CCDirector::sharedDirector();
MYGUI_PLATFORM_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice");
MYGUI_PLATFORM_LOG(Info, "* Initialise: " << getClassTypeName());
CCSize s = pDirector->getWinSizeInPixels();
this->setPosition(0, 0);
this->setContentSize(s);
setViewSize(int(s.width), int(s.height));
// 绑定到cocos2d节点
pDirector->setNotificationNode(this);
mInfo.pixWidth = s.width;
mInfo.pixHeight = s.height;
mVertexFormat = VertexColourType::ColourABGR;
mUpdate = true;
kmMat4 tmp;
kmGLGetMatrix(KM_GL_PROJECTION, &tmp);
kmMat4Inverse(&mMatrix, &tmp);
MYGUI_PLATFORM_LOG(Info, getClassTypeName() << " successfully initialized");
mIsInitialise = true;
CCNotificationCenter::sharedNotificationCenter()->addObserver(this,
callfuncO_selector(Cocos2dRenderManager::listenForeToBackground),
EVENT_COME_TO_BACKGROUND,
NULL);
pDirector->getScheduler()->scheduleUpdateForTarget(this, kCCPriorityNonSystemMin, false);
}
示例2: finishAndCleanup
//------------------------------------------------------------------------------
bool finishAndCleanup(CCScene * pInScene, CCScene * pOutScene)
{
// clean up
pInScene->setVisible(true);
pInScene->setPosition(ccp(0, 0));
pInScene->setScale(1.0f);
pInScene->setRotation(0.0f);
pInScene->getCamera()->restore();
pOutScene->setVisible(false);
pOutScene->setPosition(ccp(0, 0));
pOutScene->setScale(1.0f);
pOutScene->setRotation(0.0f);
pOutScene->getCamera()->restore();
// Before replacing, save the "send cleanup to scene"
CCDirector *director = CCDirector::sharedDirector();
director->setNotificationNode(pInScene);
return director->isSendCleanupToScene();
}