fixed #1543: The CCLayerGradient background of CocosBuilderTest can't be shown.

This commit is contained in:
James Chen 2012-10-31 18:00:51 +08:00
parent 711de87808
commit e8bf21e6a6
2 changed files with 6 additions and 0 deletions

View File

@ -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));

View File

@ -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);