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

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 layer
{Number} opacity
- Opacity of layer
{Boolean} opacityModifyRGB
- Indicate whether or not the opacity modify color

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 setLocalZOrder(int)
    {Number} tag Optional
    A integer to identify the node easily. Please refer to setTag(int)
  • {cc.Color} getColor()
    Get the color of Layer
    Returns:
    {cc.Color}
  • {cc.Color} getDisplayedColor()
    Get the displayed color of Layer
    Returns:
    {cc.Color}
  • {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.Color} color
  • setOpacity(opacity)
    Override synthesized setOpacity to recurse items
    Parameters:
    {Number} opacity
  • updateDisplayedColor(parentColor)
    update the displayed color of Node
    Parameters:
    {cc.Color} parentColor
  • updateDisplayedOpacity(parentOpacity)
    Update displayed opacity of Layer
    Parameters:
    {Number} parentOpacity