Gets the single instance of CCNotificationCenter.
Class CCNotificationCenter
#include <Geode/cocos/support/CCNotificationCenter.h>
classCCNotificationCenter:publiccocos2d::CCObject{ ... }
No description provided
Examples0
Public static methods2
staticvoidpurgeNotificationCenter()
Destroys the single instance of CCNotificationCenter.
Public member functions9
voidaddObserver(cocos2d::CCObject*target,cocos2d::SEL_CallFuncOselector,charconst*name,)
Adds an observer for the specified target.
target
The target which wants to observe notification events.
selector
The callback function which will be invoked when the specified notification event was posted.
name
The name of this notification.
obj
The extra parameter which will be passed to the callback function.
voidremoveObserver(cocos2d::CCObject*target,charconst*name)
Removes the observer by the specified target and name.
target
The target of this notification.
name
The name of this notification.
intremoveAllObservers(cocos2d::CCObject*target)
Removes all notifications registered by this target
target
The target of this notification.
the number of observers removed
voidregisterScriptObserver(cocos2d::CCObject*target,inthandler,charconst*name)
Registers one hander for script binding.
handler
The lua handler.
ℹ Only supports Lua Binding now.
voidunregisterScriptObserver(cocos2d::CCObject*target,charconst*name)
Unregisters script observer
voidpostNotification(charconst*name)
Posts one notification event by name.
name
The name of this notification.
voidpostNotification(charconst*name,cocos2d::CCObject*object)
Posts one notification event by name.
name
The name of this notification.
object
The extra parameter.
intgetScriptHandler()
Gets script handler.
The script handle.
ℹ Only supports Lua Binding now.
intgetObserverHandlerByName(charconst*name)
Gets observer script handler.
name
The name of this notification.
The observer script handle.
Fields2
cocos2d::CCArray*m_observers;
No description provided
intm_scriptHandler;
No description provided