Class cc.Layer
- Defined in: CCLayer.js
- Extends cc.Node
Constructor Attributes | Constructor Name and Description |
---|---|
cc.Layer()
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
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
-
Creates a 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