如何在cocos2d 1.1中設置ccDrawPoly()的z-index來在場景中的所有CCSprite上面繪製這個?cocos2d ccDrawPoly通過CCSprite
-(void)draw
{
CGSize screenSize = [[CCDirector sharedDirector] winSize];
glEnable(GL_LINE_SMOOTH);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glColor4ub(0, 0, 255, 255);
glLineWidth(2);
CGPoint vertices2[] = { ccp(0,0), ccp(0,screenSize.height*0.5), ccp(screenSize.width*0.5,screenSize.height*0.5), ccp(screenSize.width*0.5,0) };
ccDrawPoly(vertices2, 4, YES);
}
的z-index ccDrawPoly應大於3,在我的例子 –
在這種情況下,創建圖層,繪製所有你想在這一層,添加此圖層與zOrder 3 – Morion
沒有其他解決方案? –