We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Refactor and Improve EventDispatcher
Refactor and Improve EventDispatcher
Bug #3069 [Closed]
Status: | Closed | |
---|---|---|
Start date: | 2013-10-25 | |
Priority: | Normal | |
Due date: | ||
Assignee: | ||
% Done: | 0% |
|
Category: | all | |
Target version: | 3.0-alpha1 |
Including:
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.