Class ccs.Bone

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for ccs.Bone objects.

Method Summary

Class Detail

ccs.Bone()
Base class for ccs.Bone objects.

Method Detail

  • addChildBone(child)
    Add a child to this bone, and it will let this child call setParent(ccs.Bone) function to set self to it's parent
    Parameters:
    {ccs.Bone} child
  • addDisplay(displayData, index)
    Add display and use _displayData init the display. If index already have a display, then replace it. If index is current display index, then also change display to _index
    Parameters:
    {cc.Display} displayData
    it include the display information, like DisplayType. If you want to create a sprite display, then create a CCSpriteDisplayData param
    {Number} index
    the index of the display you want to replace or add to -1 : append display from back
  • changeDisplayByIndex(index, force)
    change display by index
    Parameters:
    {Number} index
    {Boolean} force
  • <static> {ccs.Bone} ccs.Bone.create(name)
    allocates and initializes a bone.
    // example
    var bone = ccs.Bone.create();
    Parameters:
    name
    Returns:
    {ccs.Bone}
  • {ccs.Armature} getArmature()
    armature getter
    Returns:
    {ccs.Armature}
  • {ccs.BlendType} getBlendType()
    blendType getter
    Returns:
    {ccs.BlendType}
  • {ccs.BoneData} getBoneData()
    boneData getter
    Returns:
    {ccs.BoneData}
  • {ccs.Armature} getChildArmature()
    child armature getter
    Returns:
    {ccs.Armature}
  • {Array} getChildrenBone()
    child bone getter
    Returns:
    {Array}
  • {*} getColliderBodyList()
    get the collider body list in this bone.
    Returns:
    {*}
  • {cc.ColliderFilter} getColliderFilter()
    collider filter getter
    Returns:
    {cc.ColliderFilter}
  • {ccs.DisplayManager} getDisplayManager()
    displayManager dirty getter
    Returns:
    {ccs.DisplayManager}
  • {cc.Node} getDisplayRenderNode()
    get render node
    Returns:
    {cc.Node}
  • {Number} getDisplayRenderNodeType()
    get render node type
    Returns:
    {Number}
  • {Boolean} getIgnoreMovementBoneData()
    ignoreMovementBoneData getter
    Returns:
    {Boolean}
  • {String} getName()
    name getter
    Returns:
    {String}
  • {ccs.Bone} getParentBone()
    parent bone getter
    Returns:
    {ccs.Bone}
  • {ccs.Tween} getTween()
    tween getter
    Returns:
    {ccs.Tween}
  • {ccs.FrameData} getTweenData()
    tweenData getter
    Returns:
    {ccs.FrameData}
  • {Boolean} init(name)
    Initializes a CCBone with the specified name
    Parameters:
    {String} name
    Returns:
    {Boolean}
  • {Boolean} isTransformDirty()
    transform dirty getter
    Returns:
    {Boolean}
  • {{a:0.b:0|c:0|d:0|tx:0|ty:0}} nodeToArmatureTransform()
    return world transform
    Returns:
    {{a:0.b:0|c:0|d:0|tx:0|ty:0}}
  • {cc.AffineTransform} nodeToWorldTransform()
    Returns the world affine transform matrix. The matrix is in Pixels.
    Returns:
    {cc.AffineTransform}
  • release()
    release objects
  • removeChildBone(bone, recursion)
    Removes a child bone
    Parameters:
    {ccs.Bone} bone
    {Boolean} recursion
  • removeDisplay(index)
    remove display
    Parameters:
    {Number} index
  • removeFromParent(recursion)
    Remove itself from its parent CCBone.
    Parameters:
    {Boolean} recursion
  • setArmature(armature)
    set the armature
    Parameters:
    {ccs.Armature} armature
  • setBlendType(blendType)
    blendType setter
    Parameters:
    {ccs.BlendType} blendType
  • setBoneData(boneData)
    set the boneData
    Parameters:
    {ccs.BoneData} boneData
  • setChildArmature(armature)
    child armature setter
    Parameters:
    {ccs.Armature} armature
  • setColliderFilter(filter)
    collider filter setter
    Parameters:
    {cc.ColliderFilter} filter
  • setColor(color)
    set display color
    Parameters:
    {cc.c3b} color
  • setDisplayManager()
    displayManager setter
    Parameters:
    {ccs.DisplayManager}
  • setIgnoreMovementBoneData(bool)
    When CCArmature play a animation, if there is not a CCMovementBoneData of this bone in this CCMovementData, this bone will hide. Set IgnoreMovementBoneData to true, then this bone will also show.
    Parameters:
    {Boolean} bool
  • setName(name)
    name setter
    Parameters:
    {String} name
  • setOpacity(opacity)
    set display opacity
    Parameters:
    {Number} opacity
    0-255
  • setParentBone(parent)
    Set parent bone. If _parent is NUll, then also remove this bone from armature. It will not set the CCArmature, if you want to add the bone to a CCArmature, you should use ccs.Armature.addBone(bone, parentName).
    Parameters:
    {ccs.Bone} parent
    the parent bone.
  • setTransformDirty()
    transform dirty setter
    Parameters:
    {Boolean}
  • setZOrder()
    zOrder setter
    Parameters:
    {Number}
  • update(dt)
    update worldTransform
    Parameters:
    dt
  • updateColor()
    update display color
  • updateDisplayedColor(color)
    update display color
    Parameters:
    {cc.c3b} color
  • updateDisplayedOpacity(opacity)
    update display opacity
    Parameters:
    {Number} opacity
  • updateZOrder()
    update display zOrder
  • visit(ctx)
    Rewrite visit ,when node draw, g_NumberOfDraws is changeless
    Parameters:
    ctx