Class ccs.Bone

Class Summary
Constructor Attributes Constructor Name and Description
 
ccs.Bone(name)
The Bone of Armature, it has bone data, display manager and transform data for armature.

Method Summary

Class Detail

ccs.Bone(name)
The Bone of Armature, it has bone data, display manager and transform data for armature.
var bone = new ccs.Bone("head");
Parameters:
{String} name Optional
The name of the bone

Field Detail

{ccs.Armature} armature
- The armature
{Boolean} blendDirty
- Indicate whether the blend is dirty
{ccs.BoneData} boneData
- The bone data
{ccs.Armature} childArmature
- The child armature
{Array} childrenBone
- <@readonly> All children bones
{ccs.ColliderFilter} colliderFilter
- The collider filter
{ccs.DisplayManager} displayManager
- The displayManager
{Boolean} ignoreMovementBoneData
- Indicate whether force the bone to show When CCArmature play a animation and there isn't a CCMovementBoneData of this bone in this CCMovementData.
{String} name
- The name of the bone
{ccs.Bone} parentBone
- The parent bone
{ccs.Tween} tween
- <@readonly> Tween
{ccs.FrameData} tweenData
- <@readonly> The tween data

Method Detail

  • addChildBone(child)
    Adds 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:
    {ccs.DisplayData} 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)
    Changes display by index
    Parameters:
    {Number} index
    {Boolean} force
    Deprecated:
    since v3.0, please use changeDisplayWithIndex instead.
  • changeDisplayByName(name, force)
    Changes display by name
    Parameters:
    {String} name
    {Boolean} force
    Deprecated:
    since v3.0, please use changeDisplayWithName instead.
  • changeDisplayWithIndex(index, force)
    Changes display with index
    Parameters:
    {Number} index
    {Boolean} force
  • changeDisplayWithName(name, force)
    Changes display with name
    Parameters:
    {String} name
    {Boolean} force
  • <static> {ccs.Bone} ccs.Bone.create(name)
    Allocates and initializes a bone.
    Parameters:
    name
    Deprecated:
    since v3.1, please use new construction instead
    Returns:
    {ccs.Bone}
  • {ccs.Armature} getArmature()
    Returns the armature reference of ccs.Bone.
    Returns:
    {ccs.Armature}
  • {cc.BlendFunc} getBlendFunc()
    Returns the blendFunc of ccs.Bone.
    Returns:
    {cc.BlendFunc}
  • {ccs.BoneData} getBoneData()
    Returns boneData of ccs.Bone.
    Returns:
    {ccs.BoneData}
  • {ccs.Armature} getChildArmature()
    Returns ccs.Bone's child armature.
    Returns:
    {ccs.Armature}
  • {Array} getChildrenBone()
    Returns the children of ccs.Bone
    Deprecated:
    since v3.0, please use getChildren instead.
    Returns:
    {Array}
  • {Array|null} getColliderBodyList()
    Returns the collider body list in this bone.
    Deprecated:
    since v3.0, please use getColliderDetector to get a delector, and calls its getColliderBodyList instead.
    Returns:
    {Array|null}
  • {*} getColliderDetector()
    Returns the collide detector of ccs.Bone.
    Returns:
    {*}
  • {cc.ColliderFilter} getColliderFilter()
    Returns collider filter of ccs.Bone.
    Returns:
    {cc.ColliderFilter}
  • {ccs.DisplayManager} getDisplayManager()
    displayManager dirty getter
    Returns:
    {ccs.DisplayManager}
  • {cc.Node} getDisplayRenderNode()
    Returns the display render node.
    Returns:
    {cc.Node}
  • {Number} getDisplayRenderNodeType()
    Returns the type of display render node
    Returns:
    {Number}
  • {Boolean} getIgnoreMovementBoneData()
    Returns whether is ignore movement bone data.
    Deprecated:
    since v3.0, please isIgnoreMovementBoneData instead.
    Returns:
    {Boolean}
  • {cc.AffineTransform} getNodeToArmatureTransform()
    Return the worldTransform of ccs.Bone.
    Returns:
    {cc.AffineTransform}
  • {cc.AffineTransform} getNodeToWorldTransform()
    Returns the world transform of ccs.Bone.
    Returns:
    {cc.AffineTransform}
  • {ccs.Bone} getParentBone()
    Returns the parent bone of ccs.Bone.
    Returns:
    {ccs.Bone}
  • {ccs.Tween} getTween()
    Return the tween of ccs.Bone
    Returns:
    {ccs.Tween}
  • {ccs.FrameData} getTweenData()
    Returns the tweenData of ccs.Bone.
    Returns:
    {ccs.FrameData}
  • {ccs.BaseData} getWorldInfo()
    Returns the world information of ccs.Bone.
    Returns:
    {ccs.BaseData}
  • {Boolean} init(name)
    Initializes a ccs.Bone with the specified name
    Parameters:
    {String} name
    bone name
    Returns:
    {Boolean}
  • {Boolean|*|ccs.Bone._blendDirty} isBlendDirty()
    Returns the blend dirty flag whether is dirty.
    Returns:
    {Boolean|*|ccs.Bone._blendDirty}
  • {Boolean} isIgnoreMovementBoneData()
    Returns whether is ignore movement bone data.
    Returns:
    {Boolean}
  • {Boolean} isTransformDirty()
    Returns ccs.Bone's transform dirty flag whether is dirty.
    Returns:
    {Boolean}
  • {cc.AffineTransform} nodeToArmatureTransform()
    Returns the worldTransform of ccs.Bone.
    Deprecated:
    since v3.0, please use getNodeToArmatureTransform instead.
    Returns:
    {cc.AffineTransform}
  • {cc.AffineTransform} nodeToWorldTransform()
    Deprecated:
    Returns the world affine transform matrix. The matrix is in Pixels.
    Returns:
    {cc.AffineTransform}
  • removeChildBone(bone, recursion)
    Removes a child bone
    Parameters:
    {ccs.Bone} bone
    {Boolean} recursion
  • removeDisplay(index)
    Removes display by index.
    Parameters:
    {Number} index
    display renderer's index
  • removeFromParent(recursion)
    Removes itself from its parent ccs.Bone.
    Parameters:
    {Boolean} recursion
  • setArmature(armature)
    Sets the armature reference to ccs.Bone.
    Parameters:
    {ccs.Armature} armature
  • setBlendDirty(dirty)
    Sets blend dirty flag
    Parameters:
    {Boolean} dirty
  • setBlendFunc(blendFunc, dst)
    Sets BlendFunc to ccs.Bone.
    Parameters:
    {cc.BlendFunc|Number} blendFunc
    blendFunc or src of blendFunc
    {Number} dst Optional
    dst of blendFunc
  • setBoneData(boneData)
    Sets the boneData to ccs.Bone.
    Parameters:
    {ccs.BoneData} boneData
  • setChildArmature(armature)
    Sets ccs.Bone's child armature
    Parameters:
    {ccs.Armature} armature
  • setColliderFilter(filter)
    Sets collider filter to ccs.Bone.
    Parameters:
    {ccs.ColliderFilter} filter
  • 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
  • setLocalZOrder(zOrder)
    Sets the local zOrder to ccs.Bone.
    Parameters:
    {Number} zOrder
  • setParentBone(parent)
    Sets parent bone to ccs.Bone. If _parent is NUll, then also remove this bone from armature. It will not set the ccs.Armature, if you want to add the bone to a ccs.Armature, you should use ccs.Armature.addBone(bone, parentName).
    Parameters:
    {ccs.Bone} parent
    the parent bone.
  • setTransformDirty(dirty)
    Sets ccs.Bone's transform dirty flag.
    Parameters:
    {Boolean} dirty
  • update(delta)
    Updates worldTransform by tween data and updates display state
    Parameters:
    {Number} delta
  • updateColor()
    Updates display color
  • updateDisplayedColor(color)
    Updates display color
    Parameters:
    {cc.Color} color
  • updateDisplayedOpacity(opacity)
    Updates display opacity
    Parameters:
    {Number} opacity
  • updateZOrder()
    Updates display zOrder