Class cc.LayerColor

Class Summary
Constructor Attributes Constructor Name and Description
 

CCLayerColor is a subclass of CCLayer that implements the CCRGBAProtocol protocol.

Method Summary

Class Detail

cc.LayerColor()

CCLayerColor is a subclass of CCLayer that implements the CCRGBAProtocol protocol.
All features from CCLayer are valid, plus the following new features:

  • opacity

  • RGB colors

Field Detail

draw
renders the layer
setContentSize
Sets the untransformed size of the LayerColor.

Method Detail

  • changeHeight(h)
    change height in Points
    Parameters:
    {Number} h
    height
  • changeWidth(w)
    change width in Points
    Parameters:
    {Number} w
    width
  • changeWidthAndHeight(w, h)
    change width and height in Points
    Parameters:
    {Number} w
    width
    {Number} h
    height
  • <static> {cc.LayerColor} cc.LayerColor.create(color, width, height)
    creates a cc.Layer with color, width and height in Points
    // Example
    //Create a yellow color layer as background
    var yellowBackground = cc.LayerColor.create(cc.c4b(255,255,0,255));
    //If you didnt pass in width and height, it defaults to the same size as the canvas
    
    //create a yellow box, 200 by 200 in size
    var yellowBox = cc.LayerColor.create(cc.c4b(255,255,0,255), 200, 200);
    Parameters:
    {cc.Color4B} color
    {Number|Null} width Optional
    {Number|Null} height Optional
    Returns:
    {cc.LayerColor}
  • {cc.BlendFunc} getBlendFunc()
    blendFunc getter
    Returns:
    {cc.BlendFunc}
  • {Boolean} init(color, width, height)
    Parameters:
    {cc.Color4B} color Optional
    {Number} width Optional
    {Number} height Optional
    Returns:
    {Boolean}
  • {Boolean} isOpacityModifyRGB()
    is OpacityModifyRGB
    Returns:
    {Boolean}
  • setBlendFunc(src, dst)
    blendFunc setter
    Parameters:
    {Number} src
    {Number} dst
  • setOpacityModifyRGB(value)
    set OpacityModifyRGB of cc.LayerColor
    Parameters:
    {Boolean} value