How to use CCNotificationCenter ?

How to use CCNotificationCenter ?
0.0 0


I want to show the notification to the user, even if there is a change of scenes.
Can I achieve this using CCNotificationCenter ? I would be very grateful for the example code that displays on the screen “Hello World!” and does not disappear when changing scene


CCNotificationCenter is more like signal-slot mechanic in Qt. You can notify other c++ objects (call their methods) safely from your current object. I don’t think it’s the feature you want.
What do you want is a popup message box to users?


Tnx for reply.
Yes, I want show user popup messages like “Now playing mySongName”, or like “Welcome Back….” from Game Center.


Using CCLayer + CCLabelTTF is recommended.


But I want show the notification even if scene is changed.
If I use CCLabelTTF when scene changed - CCLabelTTF disappear.
How can I add CCLabelTTF to root of scene graph?
Maybe I can use CCDirector::sharedDirector()->setNotificationNode(cocos2d::CCNode *node)?


I’m not sure if CCMessageBox meet your requirement. I only use it in debugging coz it’s ugly.


Tnx for you help.
I want something like this


Thank you for your help.
Works fine using the CCDirector::sharedDirector()->setNotificationNode(myNotyfMgr::getInstance());