How to increase the brightness of a sprite or set sprite color to white ?

found this for cocos2d:

http://www.cocos2d-iphone.org/forums/topic/how-to-increase-the-brightness-of-a-sprite-or-set-sprite-color-to-ccwhite/

not sure how to do that on cocos2d-x

CCTint is just change vertex color not ccsprite texture color.
If you use cocos2dx v1.x , refer to link site.
http://digitallybold.com/314/cocos2d-additive-sprite-color-tinting

If you use cocos2dx v2.x, use custom shader.

juyoung kim: thanks

try using the following function:-

ccBlendFunc brightnessBlend;
brightnessBlend.src = GL_SRC_ALPHA;
brightnessBlend.dst = GL_ONE;

sprite->setBlendFunc(brightnessBlend);

Paras Mendiratta wrote:

try using the following function:-
>
>
ccBlendFunc brightnessBlend;
brightnessBlend.src = GL_SRC_ALPHA;
brightnessBlend.dst = GL_ONE;
>
sprite->setBlendFunc(brightnessBlend);

Paras, do you need to call something else after that ?
It does nothing.

There is no duration for some action there too…

sprite->setBlendFunc((ccBlendFunc) { GL_SRC_ALPHA, GL_ONE });

Maybe another way to achieve the same thing:
_sprite->setColor(ccc3(r, g, b));

This post seems to be old is there any new solution to this ?

@tink3r_t The only way I managed to do this was with a custom shader, didn’t find any built-in functionality to make it work.