z order issue

z order issue
0.0 0


Is it possible to sort sprites per scene rather than per parent? For instance…

Sprite B is a child of Sprite A
Sprite C is a child of Sprite B

like this…

spriteA~~>addChild( SpriteB, 1 );
spriteB->addChild( SpriteC, 1 )

I want C to draw on top of A.

No matter what zorder I give sprite C it still draws behind sprite A


You can refer CCNode::visit(), it draws its children at this order:
draw children which zorder less than 0
draw itself
draw children which zorder greater than 0