Hi,
I worked on a project (c++) using cocos2dx that used custom events like this:
To listen:
cocos2d::EventListenerCustom *_themeEventListener;
_themeEventListener = _eventDispatcher->addCustomEventListener(ThemeEvent::EVENT, [=](EventCustom* event) {
});
_themeEventListener->retain();
To raise event:
ThemeEvent* themeEvent = ThemeEvent::create();
themeEvent->retain();
Director::getInstance()->getEventDispatcher()->dispatchCustomEvent(
ThemeEvent::EVENT, themeEvent);
themeEvent->autorelease();
Is this possible using the javascript version???
Thanks,
Tim