Dear all buddies
The hello world layer is subclassed from CCLayer
In CCLayer code there is no draw/visit method
And CCLayer is subclassed from CCNode, in CCNode's implementation file i found:
-(void) draw
{
// override me
// Only use this function to draw your staff.
// DON'T draw your stuff outside this method
}
-(void) visit
{
// quick return if not visible
if (!visible_)
return;
glPushMatrix();
if ( grid_ && grid_.active) {
[grid_ beforeDraw];
[self transformAncestors];
}
[self transform];
if(children_) {
ccArray *arrayData = children_->data;
NSUInteger i = 0;
// draw children zOrder < 0
for( ; i < arrayData->num; i++ ) {
CCNode *child = arrayData->arr[i];
if ( [child zOrder] < 0 )
[child visit];
else
break;
}
// self draw
[self draw];
// draw children zOrder >= 0
for( ; i < arrayData->num; i++ ) {
CCNode *child = arrayData->arr[i];
[child visit];
}
} else
[self draw];
if ( grid_ && grid_.active)
[grid_ afterDraw:self];
glPopMatrix();
}
So there is still nothing to draw a black background right? Where is the black comes from?
Hope heard from you, thanks!