Class cc.NodeRGBA

Class Summary
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.

Field Detail

{Boolean} cascadeColor
- Indicate whether or not it will set cascade color
{Boolean} cascadeOpacity
- Indicate whether or not it will set cascade opacity
{cc.Color} color
- Color of node
{Number} opacity
- Opacity of node
{Boolean} opacityModifyRGB
- Indicate whether or not the opacity modify color

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.Color} getColor()
    Get the color of Node
    Returns:
    {cc.Color}
  • {cc.Color} getDisplayedColor()
    Get the displayed color of Node
    Returns:
    {cc.Color}
  • {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.Color} color
    When color not set alpha like cc.color(128,128,128),only change the color. When color set alpha like cc.color(128,128,128,100),then change the color and alpha.
  • setOpacity(opacity)
    Set the opacity of Node
    Parameters:
    {Number} opacity
  • updateDisplayedColor(parentColor)
    update the displayed color of Node
    Parameters:
    {cc.Color} parentColor
  • updateDisplayedOpacity(parentOpacity)
    Update displayed opacity
    Parameters:
    {Number} parentOpacity