The transparecy of CCNode

The transparecy of CCNode
0.0 0


I have been working on a project using cocos2dx (version: cocos2d-2.0-rc2-x-2.0.1) as its renderer for several months. CCNode is the base class of all renderable elements as we all know. Any instance of CCNode can be added as a child to a parent node which can be treated as single renderable unit (I mean a subtree can be treated as a single object logically). Here comes a problem: when I have a game object consist of many child nodes (e.g. a very complex boss with a lot of animations) and I want to fade out it (when the boss dies typically), maybe I have to run actions on all child sprites. This is obviously unreasonable. Are there any solutions? One reasonable way should be like this: run FadeOut action on the root of a subtree and all nodes in this subtree can be affected.
I’m very confused why CCNode didn’t implement the CCRGBAProtocal. A CCNode is a renderable object, and all renderable objects should have its color. I can’t find any excuses not doing so. As far as I kown, flash (Action Script 3) has a ‘alpha’ property in DisplayObject (the same role as CCNode) and this can affect all its children. More gernerally, it has a color transform which can easily change the color of a logical display object (a subtree).
I’ll be very glad to see these features in future cocos2d versions.


yep, I don’t know the implementation details about the CCNode but it would be an interesting feature.