RoundPi
RoundPi

Reputation: 5947

Complete transparent drawing in cocos2d

I am drawing a circle using cocos2d, I set alpha to 0 using glColor4ub, the drawing turned into transparent, I can see a ccsprite in a layer below, that's expected.

But my question is why the drawing didn't turn into complete transparent since I set the alpha to 0 so that I cannot see the drawing but only the ccsprite below ?

If i am doing wrong , how should I fix it ?

- (void ) draw
{
    glLineWidth(20);
    glColor4ub(0, 255, 255, 0); //here I set alpha to 0
    ccDrawCircle( ccp(100,100), 50, 0, 50, YES);
}

Thanks

Upvotes: 1

Views: 953

Answers (1)

Gregory Atchley-Martin
Gregory Atchley-Martin

Reputation: 176

I not sure why the circle is not completely transparent but I've had problems trying to use glColor4ub() when making cocos2d drawing calls. I would recommend replacing the glColor4ub(0, 255, 255, 0); with ccDrawColor4B(0, 255, 255, 0); and that should fix your problem and get the circle to be completely transparent.

Upvotes: 3

Related Questions