Class cc.NodeRGBA
Constructor Attributes | Constructor Name and Description |
---|---|
cc.NodeRGBA is a subclass of cc.Node that implements the CCRGBAProtocol protocol. |
Method Summary
Class Detail
cc.NodeRGBA()
cc.NodeRGBA is a subclass of cc.Node that implements the CCRGBAProtocol protocol.
All features from CCNode are valid, plus the following new features:
- opacity
- RGB colors
Opacity/Color propagates into children that conform to the CCRGBAProtocol if cascadeOpacity/cascadeColor is enabled.
Method Detail
-
addChild(child, zOrder, tag)add a child to node
- Parameters:
- {cc.Node} child
- A child node
- {Number} zOrder Optional
- Z order for drawing priority. Please refer to setZOrder(int)
- {Number} tag Optional
- A integer to identify the node easily. Please refer to setTag(int)
-
{cc.Color3B} getColor()Get the color of Node
- Returns:
- {cc.Color3B}
-
{cc.Color3B} getDisplayedColor()Get the displayed color of Node
- Returns:
- {cc.Color3B}
-
{number} getDisplayedOpacity()Get the displayed opacity of Node
- Returns:
- {number} displayed opacity
-
{number} getOpacity()Get the opacity of Node
- Returns:
- {number} opacity
-
{boolean} isCascadeColorEnabled()whether or not it will set cascade color.
- Returns:
- {boolean}
-
{boolean} isCascadeOpacityEnabled()whether or not it will set cascade opacity.
- Returns:
- {boolean}
-
setCascadeColorEnabled(cascadeColorEnabled)Enable or disable cascade color
- Parameters:
- {boolean} cascadeColorEnabled
-
setCascadeOpacityEnabled(cascadeOpacityEnabled)Enable or disable cascade opacity
- Parameters:
- {boolean} cascadeOpacityEnabled
-
setColor(color)Set the color of Node
- Parameters:
- {cc.Color3B} color
-
setOpacity(opacity)Set the opacity of Node
- Parameters:
- {Number} opacity
-
updateDisplayedColor(parentColor)update the displayed color of Node
- Parameters:
- {cc.Color3B} parentColor
-
updateDisplayedOpacity(parentOpacity)Update displayed opacity
- Parameters:
- {Number} parentOpacity