Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CCSprite Fadeout with children

I'm using a CCSprite with a few other CCSprite objects added as children, the other animations I'm using (scale and rotate) work great and the children are animated too. But when I'm using CCFadeOut, it only fades the parent.

I've read that fadeout doesn't apply to the children. Is there any way other than iterating over every child and calling the fadeout on each of them?

like image 609
Thomas Avatar asked Dec 05 '22 14:12

Thomas


1 Answers

As of Cocos2d ver. 2.1, CCNodeRGBA has a "CascadeOpacity" BOOL property. Set it to YES on the parent CCSprite to fade out the children nodes as well as the parent.

like image 75
gdbj Avatar answered Dec 27 '22 04:12

gdbj