I want to create a white flash effect to an enemy object when he was attacked. But no have solution. Anybody could help me?
Anyway create a white flash effect to an Object when invoke event?
(5 posts) (3 voices)-
Posted 2 years ago #
-
I think you'll probably need to use a solution similar to the ones discussed in these threads... Check them out and maybe it'll help!
Posted 2 years ago # -
Thanks for your suggestion. It really useful :)
Posted 1 year ago # -
I've done it. Just simple code.
//make sprite glow, self is AtlasSpriteManager object.
- (void) setGlow {
[self setBlendFunc: (ccBlendFunc) { GL_SRC_ALPHA, GL_ONE }];
[self schedule:@selector(restoreNormalStateOfSprite) interval:0.05];
}
//restore normal state.
- (void) restoreNormalStateOfSprite {
[self unschedule:@selector(restoreNormalStateOfSprite)];
[self setBlendFunc: (ccBlendFunc) { GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }];
}Posted 1 year ago # -
@vinhsteven: will it works on CCSprite??i tried
[original setBlendFunc: (ccBlendFunc) { GL_SRC_ALPHA, GL_ONE }];
where original is a CCSprite and reset
[original setBlendFunc: (ccBlendFunc) { GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }];but no change.......can help??
Posted 8 months ago #
Reply
You must log in to post.