Skip to main content

CCLayerMultiplex

CCLayerMultiplex

Cocos2D

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

Inheritance: System.Object → Cocos2D.CCNode → Cocos2D.CCLayer → Cocos2D.CCLayerRGBA

Implements: Cocos2D.ICCSelectorProtocol, Cocos2D.ICCFocusable, Cocos2D.ICCTargetedTouchDelegate, Cocos2D.ICCStandardTouchDelegate, Cocos2D.ICCTouchDelegate, Cocos2D.ICCKeypadDelegate, Cocos2D.ICCKeyboardDelegate, System.Collections.Generic.IComparer{Cocos2D.CCNode}, Cocos2D.ICCAccelerometerDelegate, Cocos2D.ICCRGBAProtocol

Constructors

CCLayerMultiplex()

CCLayerMultiplex()()

CCLayerMultiplex(CCAction, CCAction)

CCLayerMultiplex(CCAction, CCAction)(Cocos2D.CCAction inAction, Cocos2D.CCAction outAction)
Parameters:
inAction (Cocos2D.CCAction)
outAction (Cocos2D.CCAction)

CCLayerMultiplex(CCAction, CCAction, CCLayer)

CCLayerMultiplex(CCAction, CCAction, CCLayer)(Cocos2D.CCAction inAction, Cocos2D.CCAction outAction, Cocos2D.CCLayer layer)
Parameters:
inAction (Cocos2D.CCAction)
outAction (Cocos2D.CCAction)
layer (Cocos2D.CCLayer)

CCLayerMultiplex(CCAction, CCAction, params CCLayer[])

CCLayerMultiplex(CCAction, CCAction, params CCLayer[])(Cocos2D.CCAction inAction, Cocos2D.CCAction outAction, Cocos2D.CCLayer[] layer)
Parameters:
inAction (Cocos2D.CCAction)
outAction (Cocos2D.CCAction)
layer (Cocos2D.CCLayer[])

CCLayerMultiplex(params CCLayer[])

CCLayerMultiplex(params CCLayer[])(Cocos2D.CCLayer[] layer)

creates a CCLayerMultiplex with one or more layers using a variable argument list.

Parameters:
layer (Cocos2D.CCLayer[])
Example

Fields

NoLayer(System.Int32)

Indicates no layer to be displayed.

m_nEnabledLayer(System.Int32)

Current index of the active layer.

m_pLayers(System.Collections.Generic.DictionarySystem.Int32,Cocos2D.CCLayer)

Properties

ActiveLayer(Cocos2D.CCLayer)

Returns the active layer that was last selected. This method will return null if no layer has been selected.

InAction(Cocos2D.CCAction)

The action to play on the layer that becomes the active layer

OutAction(Cocos2D.CCAction)

The action to play on the active layer when it becomes inactive.

ShowFirstLayerOnEnter(System.Boolean)

Methods

AddLayer(CCLayer)

AddLayer(CCLayer)(Cocos2D.CCLayer layer)

Adds the given layer to the list of layers to multiplex. The CCNode.Tag is used as thelayer tag, but is offset by the kTagOffsetForUniqueness constant.

Parameters:
layer (Cocos2D.CCLayer)
Example

OnEnter()

OnEnter()()

This will switch to the first layer if the ShowFirstLayerOnEnter flag is true and there is a layer in the list of multiplexed layers.

Example

SwitchTo(int)

Cocos2D.CCLayer SwitchTo(int)(System.Int32 n)

Swtich to the given index layer and use the given action after the layer is added to the parent. The parameter can be the index or it can be the tag of the layer.

Parameters:
n (System.Int32) - Send in NoLayer to hide all multiplexed layers. Otherwise, send in a tag or the logical index of the layer to show.
Returns:
Cocos2D.CCLayer - The layer that is going to be shown. This can return null if the SwitchTo layer is NoLayer
Example

SwitchToAndReleaseMe(int)

Cocos2D.CCLayer SwitchToAndReleaseMe(int)(System.Int32 n)

Switches to the new layer and removes the old layer from management.

Parameters:
n (System.Int32)
Returns:
Cocos2D.CCLayer
Example

SwitchToFirstLayer()

Cocos2D.CCLayer SwitchToFirstLayer()()

Switches to the first layer.

Returns:
Cocos2D.CCLayer
Example

SwitchToNextLayer()

Cocos2D.CCLayer SwitchToNextLayer()()

Switches to the next logical layer that was added to the multiplexer. Switches to the first layer when no layer is active.

Returns:
Cocos2D.CCLayer
Example

SwitchToNone()

SwitchToNone()()

Hides the current display layer and sets the current enabled layer to none. The out action is played for the current display layer. Calling this method will also set ShowFirstLayerOnEnter to false.

Example

SwitchToPreviousLayer()

Cocos2D.CCLayer SwitchToPreviousLayer()()

Switches to the previous logical layer that was added to the multiplexer. Switches to the first layer when no layer is active.

Returns:
Cocos2D.CCLayer
Example