diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index cbe60c15e3..a670abb7ec 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -667,6 +667,11 @@ CCLayerGradient* CCLayerGradient::create(const ccColor4B& start, const ccColor4B return NULL; } +bool CCLayerGradient::init() +{ + return initWithColor(ccc4(0, 0, 0, 255), ccc4(0, 0, 0, 255)); +} + bool CCLayerGradient::initWithColor(const ccColor4B& start, const ccColor4B& end) { return initWithColor(start, end, ccp(0, -1)); diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h index 7c3caf0d96..e166ff8c8a 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h @@ -262,6 +262,7 @@ public: /** Creates a full-screen CCLayer with a gradient between start and end in the direction of v. */ static CCLayerGradient* create(const ccColor4B& start, const ccColor4B& end, const CCPoint& v); + virtual bool init(); /** Initializes the CCLayer with a gradient between start and end. */ virtual bool initWithColor(const ccColor4B& start, const ccColor4B& end);