Highlighting a sprite!

Highlighting a sprite!
0.0 0


I am trying to highlight a cube without adding another sprite(that is highlighted). From what I understand this is the the way to do it but it doesn’t work:
// Draw empty block
pBlock~~>blockSprite = CCSprite::spriteWithSpriteFrameName;
Nothing happens, sprite draws on the screen like it would normally, not highlighted?!
what am i doing wrong?


i also want to glow on sprite as highlighted

if someone have any idea then please help us .


I found out what I was doing wrong, I was applying the set blend function to a sprite which was from a sprite sheet! sprite sheets have their own set blend functions therefore you could only apply the blend function to the sprite sheet as a whole! otherwise try to load your sprite from a file separate from the sprite sheet and then apply the setblend to highlight.

above setblend function is correct and it should work, but alternatively You could try this blend func: sprite.blendFunc = (ccBlendFunc) { GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA };
Also, try altering the color of the sprite in combination with this blend function. Like set the color to: sprite.color = ccc3(155, 155, 155); and adjust the tone for brightness.

Hope that helps!


very good



CCSize winSize=CCDirector::sharedDirector()->getWinSize();
bird= CCSprite::spriteWithFile("bird.png");
ccBlendFunc blnd={(int) GL_SRC_ALPHA,(int) GL_ONE_MINUS_SRC_ALPHA };

Nothing happens, sprite draws on the screen like it would normally, not highlighted?!. am i doing something wrong ?