Class cc.ParallaxNode

Class Summary
Constructor Attributes Constructor Name and Description
 

cc.ParallaxNode: A node that simulates a parallax scroller
The children will be moved faster / slower than the parent according the the parallax ratio.

Method Summary

Class Detail

cc.ParallaxNode()

cc.ParallaxNode: A node that simulates a parallax scroller
The children will be moved faster / slower than the parent according the the parallax ratio.

Method Detail

  • addChild(child, z, ratio, offset)
    Adds a child to the container with a z-order, a parallax ratio and a position offset It returns self, so you can chain several addChilds.
    //example
    voidNode.addChild(background, -1, cc.p(0.4, 0.5), cc.PointZero());
    Parameters:
    {cc.Node} child
    {Number} z
    {cc.Point} ratio
    {cc.Point} offset
  • <static> {cc.ParallaxNode} cc.ParallaxNode.create()
    //example
    var voidNode = cc.ParallaxNode.create();
    Returns:
    {cc.ParallaxNode}
  • ctor()
    Constructor
  • {Array} getParallaxArray()
    Returns:
    {Array}
  • removeAllChildren(cleanup)
    Remove all children with cleanup
    Parameters:
    {Boolean} cleanup
  • removeChild(child, cleanup)
    Remove Child
    //example
    voidNode.removeChild(background,true);
    Parameters:
    {cc.Node} child
    {Boolean} cleanup
  • setParallaxArray(value)
    Parameters:
    {Array} value
  • visit()
    Visit