Projects > cpp > Issues > Bug #3069

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Refactor and Improve EventDispatcher

Bug #3069 [Closed]
dumganhar 2013-10-25 07:44 . Updated almost 3 years ago


1) EventListenerTouch has to be separated to EventListenerTouchOneByOne and EventListenerTouchAllAtOnce, it will be clearer for developer to decide to use which type of touch event listener.

2) Remove all controller codes from cocos2d::Layer. Layer should not be a controller. All event listener registrations should use EventDispatcher.

3) Don’t insert member variables which are not relevant to Node. Node should be as small, fast as possible.

4) Improve the SORT logic of EventListener, we should divide event listeners into two parts and store them in different vectors. One is for fixed priority event listeners, another is for scene graph based priority listeners. In this way, when a listener’s priority is changed, only one of the vectors should be sorted.

zhangxm 2013-11-16 10:08
  • Status changed from New to Closed

Atom PDF

Start date:2013-10-25
Due date:
% Done:


Target version:3.0-alpha1

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.