How To Subclass Sprite And Add Event Listeners¶ Cocos2d-x 3.0 adds a new EventDispatcher mechanism. Now Sprites can have events attached directly to them. This How To will show you how to subclass Sprite and add event listeners. in your header file: #ifndef _MYSPRITE_HPP_ #define _MYSPRITE_HPP_ #include "cocos2d.h" class MySprite : public cocos2d::Sprite { public: MySprite(); ~MySprite(); static M