cocos2d/cocos2d-iphone — pull request #773 by chunkyguy (2014-05-22 02:41:13+00:00)
Title: CCNodeGradientRadialColor class: draw radial gradient with GL_TRIANGLE_FAN 

CCNodeGradientRadial is a CCNode that can be used to display radial gradient

It isn't a subclass of CCNodeColor or CCNodeGradient because:

1. CCNodeColor only has 4 vertex available whereas for a gradient effect we need more vertices.
2. CCNodeColor uses GL_TRIANGLE_STRIP for rendering but for radial gradient we're using GL_TRIANGLE_FAN

Still the CCNodeGradientRadial's interface is kept as close to CCNodeGradient so that the gradient effect could be switched with minimum efforts.

Here's a screenshot from my game in development:
![img_0680](https://cloud.githubusercontent.com/assets/213683/3049181/4cbb016e-e158-11e3-8612-93e3d4fdaa04.PNG)

I searched the internet for a way to draw radial backgrounds, but most of the people were suggesting using a texture or implementing using a fragment shader. I think with GL_TRIANGLE_FAN we can get a descent enough result with less performance overhead compared to the other two suggestions.

I've also added a test case and here's the result:

![screenshot 2014-05-22 07 59 57](https://cloud.githubusercontent.com/assets/213683/3049210/07dd9ae2-e159-11e3-8b34-b36dc9174761.png)

I'm new to the cocos2d and I'm still at level 0 with git. The cocos2d repository is already so complicated for me, sorry for anything stupid that I might have already done. Please let me know how it works out.

Thanks for all your great work, I would love to get more involved in the future with the development :)

- Sid.