// // AniTouchInterceptingLayer.hpp // SteveMaggieCpp // // Created by Katarzyna Kalinowska-Górska on 12.05.2017. // // #ifndef AniTouchInterceptingLayer_h #define AniTouchInterceptingLayer_h #include #include "cocos2d.h" class AniTouchInterceptingLayer : public cocos2d::LayerColor { public: static const int TouchEventListenerPriority = -100; // create static AniTouchInterceptingLayer * create(const cocos2d::Color4B& color, bool sceneGraphPriority = true); // init virtual bool initWithColor(const cocos2d::Color4B& color, bool sceneGraphPriority = true); virtual void configureTouchListener(bool sceneGraphPriority = true); // setters virtual void setOnTouchCallback(const std::function& onTouchCallback); virtual void setOnTouchMovedCallback(const std::function& onTouchCallback); virtual void setOnTouchEndedCallback(const std::function& onTouchCallback); virtual void clearTouchHandlers(); protected: std::function _onTouchCallback; std::function _onTouchMovedCallback; std::function _onTouchEndedCallback; }; #endif /* AniTouchInterceptingLayer_hpp */