Class cc.LayerMultiplex

Class Summary
Constructor Attributes Constructor Name and Description
 
CCMultipleLayer is a CCLayer with the ability to multiplex it's children.

Method Summary

Class Detail

cc.LayerMultiplex(layers)
CCMultipleLayer is a CCLayer with the ability to multiplex it's children.
Features:
  • - It supports one or more children
  • - Only one children will be active a time
// Example
var multiLayer = new cc.LayerMultiple(layer1, layer2, layer3);//any number of layers
Parameters:
{Array} layers
an array of cc.Layer

Method Detail

  • addLayer(layer)
    Add a layer to the multiplex layers list
    Parameters:
    {cc.Layer} layer
  • <static> {cc.LayerMultiplex|Null} cc.LayerMultiplex.create()
    Creates a cc.LayerMultiplex with one or more layers using a variable argument list.
    Deprecated:
    since v3.0, please use new construction instead
    Returns:
    {cc.LayerMultiplex|Null}
    See:
    cc.LayerMultiplex
  • ctor(layers)
    Constructor of cc.LayerMultiplex
    Parameters:
    {Array} layers
    an array of cc.Layer
  • {Boolean} initWithLayers(layers)
    Initialization of the layer multiplex, please do not call this function by yourself, you should pass the parameters to constructor to initialize a layer multiplex
    Parameters:
    {Array} layers
    an array of cc.Layer
    Returns:
    {Boolean}
  • switchTo(n)
    Switches to a certain layer indexed by n.
    The current (old) layer will be removed from it's parent with 'cleanup:YES'.
    Parameters:
    {Number} n
    the layer index to switch to
  • switchToAndReleaseMe(n)
    Release the current layer and switches to another layer indexed by n.
    The current (old) layer will be removed from it's parent with 'cleanup:YES'.
    Parameters:
    {Number} n
    the layer index to switch to