2

I'm making a simple game using cocos2d and all I need now is to draw filled polygon with gradient on background. I have background layer class, subclass of CCLayer, I overwrote draw() method and put this stuff:

CGPoint verticesHill [] = { pointHill0, pointHill1, pointHill2, pointHill3, pointHill4, pointHill5 };
ccDrawSolidPoly(verticesHill, 6, ccc4FFromccc3B(ccc3(162,122,87)));

of course I defined all 6 points before. But now I need to draw this poly with gradient, how can I do it? is it possible to do it with openGL? may be I shoud subclass CCLayerGradient, set colors and clip the layer to my poly? cause layer will be rectangle

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.