From 02572da9dc66398d40cebdb3ed65f246eeeb0973 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 5 Mar 2014 11:25:33 +0800 Subject: [PATCH] Adds EventListenerTouchOneByOne::isSwallowTouches, fixes a typo for Director::EVENT_AFTER_UPDATE. --- cocos/2d/CCDirector.cpp | 2 +- cocos/2d/CCEventListenerTouch.cpp | 5 +++++ cocos/2d/CCEventListenerTouch.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index 4d6f9b2d51..f74d962c38 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -88,7 +88,7 @@ extern const char* cocos2dVersion(void); const char *Director::EVENT_PROJECTION_CHANGED = "director_projection_changed"; const char *Director::EVENT_AFTER_DRAW = "director_after_draw"; const char *Director::EVENT_AFTER_VISIT = "director_after_visit"; -const char *Director::EVENT_AFTER_UPDATE = "director_after_udpate"; +const char *Director::EVENT_AFTER_UPDATE = "director_after_update"; Director* Director::getInstance() { diff --git a/cocos/2d/CCEventListenerTouch.cpp b/cocos/2d/CCEventListenerTouch.cpp index a9b423c5d8..2dbbbe8d41 100644 --- a/cocos/2d/CCEventListenerTouch.cpp +++ b/cocos/2d/CCEventListenerTouch.cpp @@ -61,6 +61,11 @@ void EventListenerTouchOneByOne::setSwallowTouches(bool needSwallow) _needSwallow = needSwallow; } +bool EventListenerTouchOneByOne::isSwallowTouches() +{ + return _needSwallow; +} + EventListenerTouchOneByOne* EventListenerTouchOneByOne::create() { auto ret = new EventListenerTouchOneByOne(); diff --git a/cocos/2d/CCEventListenerTouch.h b/cocos/2d/CCEventListenerTouch.h index 7577bbc180..4b608e1755 100644 --- a/cocos/2d/CCEventListenerTouch.h +++ b/cocos/2d/CCEventListenerTouch.h @@ -43,6 +43,7 @@ public: virtual ~EventListenerTouchOneByOne(); void setSwallowTouches(bool needSwallow); + bool isSwallowTouches(); /// Overrides virtual EventListenerTouchOneByOne* clone() override;