Q:

Cocos2d: help understanding setblendfunc to blend sprites

New to OpenGL and cocos2d and struggling to understand the setBlendFunc on sprites. Where can I get an explanation of the constants used.
I am trying to allow a user to rub away a sprite and see what is below it. This would only be for a certain sprite on the page.
Any tips greatly appreciated.

A:

Try reading documentation on OpenGL ES 1_0 glBlendFunc
I believe what you are looking for is (ccBlendFunc){GL_ZERO, GL_ZERO} as it will clear both source and destination or try (ccBlendFunc){GL_ZERO, GL_ONE_MINUS_SRC_ALPHA} which will clear the source (the image with which you want to scratch the surface - circle or whatever make it to have alpha == 1 where you want it to clear and alpha == 0 (full transparency) outside the area) and will set the alpha of destination (background) to 0 as it will substract 1 from whatever was set there - most likely one as well.

