From b6f78b257f43b4cbbe424e1c71051630bb4baa40 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 15 Jul 2013 16:06:59 +0800 Subject: [PATCH] closed #2403: Reverting commit 239323c to fix the bug that Tint and Fade action can't work for ProgressTimer. --- cocos2dx/misc_nodes/CCProgressTimer.cpp | 20 ++++++++++++++++---- cocos2dx/misc_nodes/CCProgressTimer.h | 6 ++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cocos2dx/misc_nodes/CCProgressTimer.cpp b/cocos2dx/misc_nodes/CCProgressTimer.cpp index 84caf804fc..78efce308b 100644 --- a/cocos2dx/misc_nodes/CCProgressTimer.cpp +++ b/cocos2dx/misc_nodes/CCProgressTimer.cpp @@ -149,14 +149,26 @@ void ProgressTimer::setReverseProgress(bool reverse) } } -void ProgressTimer::setOpacityModifyRGB(bool bValue) +void ProgressTimer::setColor(const Color3B& color) { - CC_UNUSED_PARAM(bValue); + _sprite->setColor(color); + updateColor(); } -bool ProgressTimer::isOpacityModifyRGB(void) const +const Color3B& ProgressTimer::getColor() const { - return false; + return _sprite->getColor(); +} + +void ProgressTimer::setOpacity(GLubyte opacity) +{ + _sprite->setOpacity(opacity); + updateColor(); +} + +GLubyte ProgressTimer::getOpacity() const +{ + return _sprite->getOpacity(); } // Interval diff --git a/cocos2dx/misc_nodes/CCProgressTimer.h b/cocos2dx/misc_nodes/CCProgressTimer.h index 562c9aafa7..267db015b7 100644 --- a/cocos2dx/misc_nodes/CCProgressTimer.h +++ b/cocos2dx/misc_nodes/CCProgressTimer.h @@ -82,8 +82,10 @@ public: virtual void draw(void); void setAnchorPoint(const Point& anchorPoint); - virtual void setOpacityModifyRGB(bool bValue); - virtual bool isOpacityModifyRGB(void) const; + virtual void setColor(const Color3B& color); + virtual const Color3B& getColor() const; + virtual GLubyte getOpacity() const; + virtual void setOpacity(GLubyte opacity); inline bool isReverseDirection() { return _reverseDirection; }; inline void setReverseDirection(bool value) { _reverseDirection = value; };