Class cc.LayerRGBA

Class Summary
Constructor Attributes Constructor Name and Description
 

CCLayerRGBA is a subclass of CCLayer that implements the CCRGBAProtocol protocol using a solid color as the background.

Method Summary

Class Detail

cc.LayerRGBA()

CCLayerRGBA is a subclass of CCLayer that implements the CCRGBAProtocol protocol using a solid color as the background.
All features from CCLayer are valid, plus the following new features that propagate into children that conform to the CCRGBAProtocol:
- opacity
- RGB colors

Method Detail

  • addChild(child, zOrder, tag)
    add a child to layer
    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 Layer
    Returns:
    {cc.Color3B}
  • {cc.Color3B} getDisplayedColor()
    Get the displayed color of Layer
    Returns:
    {cc.Color3B}
  • {number} getDisplayedOpacity()
    Get the displayed opacity of Layer
    Returns:
    {number} displayed opacity
  • {number} getOpacity()
    Get the opacity of Layer
    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 Layer
    Parameters:
    {cc.Color3B} color
  • setOpacity(opacity)
    Override synthesized setOpacity to recurse items
    Parameters:
    {Number} opacity
  • updateDisplayedColor(parentColor)
    update the displayed color of Node
    Parameters:
    {cc.Color3B} parentColor
  • updateDisplayedOpacity(parentOpacity)
    Update displayed opacity of Layer
    Parameters:
    {Number} parentOpacity