Class ccs.Armature

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

Method Summary

Class Detail

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

Field Detail

{ccs.ArmatureAnimation} animation
- The animation
{ccs.ArmatureData} armatureData
- The armature data
{cc.SpriteBatchNode} batchNode
- The batch node of the armature
{Object} body
- The body of the armature
{ccs.ColliderFilter} colliderFilter
- <@writeonly> The collider filter of the armature
{String} name
- The name of the armature
{ccs.Bone} parentBone
- The parent bone of the armature node
{Number} version
- The version

Method Detail

  • addBone(bone, parentName)
    Add a Bone to this Armature
    Parameters:
    {ccs.Bone} bone
    The Bone you want to add to Armature
    {String} parentName
    The parent Bone's name you want to add to. If it's null, then set Armature to its parent
  • changeBoneParent(bone, parentName)
    Change a bone's parent with the specified parent name.
    Parameters:
    {ccs.Bone} bone
    The bone you want to change parent
    {String} parentName
    The new parent's name
  • <static> {ccs.Armature} ccs.Armature.create(name, parentBone)
    Allocates an armature, and use the ArmatureData named name in ArmatureDataManager to initializes the armature.
    // example
    var armature = ccs.Armature.create();
    Parameters:
    {String} name Optional
    Bone name
    {ccs.Bone} parentBone Optional
    the parent bone
    Returns:
    {ccs.Armature}
  • {ccs.Bone} createBone(boneName)
    create a bone with name
    Parameters:
    {String} boneName
    Returns:
    {ccs.Bone}
  • ctor(name, parentBone)
    Create a armature node. Constructor of ccs.Armature
    var armature = new ccs.Armature();
    Parameters:
    {String} name
    {ccs.Bone} parentBone
  • drawContour()
    draw contour
  • {ccs.ArmatureAnimation} getAnimation()
    Gets the animation of this Armature.
    Returns:
    {ccs.ArmatureAnimation}
  • {ccs.ArmatureData} getArmatureData()
    Gets the armatureData of this Armature
    Returns:
    {ccs.ArmatureData}
  • {Boolean} getArmatureTransformDirty()
    armatureTransformDirty getter
    Returns:
    {Boolean}
  • {cc.BlendFunc} getBlendFunc()
    blendFunc getter
    Returns:
    {cc.BlendFunc}
  • {ccs.Bone} getBone(name)
    Gets a bone with the specified name
    Parameters:
    {String} name
    The bone's name you want to get
    Returns:
    {ccs.Bone}
  • {ccs.Bone} getBoneAtPoint(x, y)
    when bone contain the point ,then return it.
    Parameters:
    {Number} x
    {Number} y
    Returns:
    {ccs.Bone}
  • {Object} getBoneDic()
    Get CCArmature's bone dictionary
    Returns:
    {Object} Armature's bone dictionary
  • {cc.Rect} getBoundingBox()
    This boundingBox will calculate all bones' boundingBox every time
    Returns:
    {cc.Rect}
  • {ccs.Bone} getParentBone()
    return parent bone
    Returns:
    {ccs.Bone}
  • {Number} getVersion()
    version getter
    Returns:
    {Number}
  • {Boolean} init(name, parentBone)
    Initializes a CCArmature with the specified name and CCBone
    Parameters:
    {String} name Optional
    {ccs.Bone} parentBone Optional
    Returns:
    {Boolean}
  • removeBone(bone, recursion)
    Remove a bone with the specified name. If recursion it will also remove child Bone recursively.
    Parameters:
    {ccs.Bone} bone
    The bone you want to remove
    {Boolean} recursion
    Determine whether remove the bone's child recursion.
  • setAnimation(animation)
    Sets animation to this Armature
    Parameters:
    {ccs.ArmatureAnimation} animation
  • setArmatureData(armatureData)
    Sets armatureData to this Armature
    Parameters:
    {ccs.ArmatureData} armatureData
  • setBlendFunc(blendFunc)
    conforms to cc.TextureProtocol protocol
    Parameters:
    {cc.BlendFunc} blendFunc
  • setColliderFilter(filter)
    set collider filter
    Parameters:
    {ccs.ColliderFilter} filter
  • setParentBone(parentBone)
    Sets parent bone of this Armature
    Parameters:
    {ccs.Bone} parentBone
  • setVersion(version)
    version setter
    Parameters:
    {Number} version
  • updateOffsetPoint()
    Set contentSize and Calculate anchor point.