Class cc.Layer

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.Layer is a subclass of cc.Node that implements the TouchEventsDelegate protocol.

Method Summary

Class Detail

cc.Layer()
cc.Layer is a subclass of cc.Node that implements the TouchEventsDelegate protocol.
All features from cc.Node are valid, plus the bake feature: Baked layer can cache a static layer to improve performance

Method Detail

  • bake()
    Sets the layer to cache all of children to a bake sprite, and draw itself by bake sprite. recommend using it in UI.
    This is useful only in html5 engine
    See:
    cc.Layer#unbake
  • <static> {cc.Layer|Null} cc.Layer.create()
    Creates a layer
    Deprecated:
    since v3.0, please use the new construction instead
    Returns:
    {cc.Layer|Null}
    See:
    cc.Layer
  • ctor()

    Constructor of cc.Layer, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.

  • init()
    Initialization of the layer, please do not call this function by yourself, you should pass the parameters to constructor to initialize a layer
  • {boolean} isBaked()
    Determines if the layer is baked.
    Returns:
    {boolean}
    See:
    cc.Layer#bake and cc.Layer#unbake
  • unbake()
    Cancel the layer to cache all of children to a bake sprite.
    This is useful only in html5 engine
    See:
    cc.Layer#bake