diff --git a/extensions/cocostudio/armature/CCArmature.js b/extensions/cocostudio/armature/CCArmature.js
index 540bed7164..b7cc12c406 100644
--- a/extensions/cocostudio/armature/CCArmature.js
+++ b/extensions/cocostudio/armature/CCArmature.js
@@ -24,7 +24,7 @@
****************************************************************************/
/**
- * Base class for ccs.Armature objects.
+ * The main class of Armature, it plays armature animation, manages and updates bones' state.
* @class
* @extends ccs.Node
*
@@ -70,7 +70,6 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
this._offsetPoint = cc.p(0, 0);
this._armatureTransformDirty = true;
this._realAnchorPointInPoints = cc.p(0, 0);
-
name && ccs.Armature.prototype.init.call(this, name, parentBone);
},
@@ -277,6 +276,12 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
this.setAnchorPoint(locOffsetPoint.x / rect.width, locOffsetPoint.y / rect.height);
},
+ /**
+ * Sets armature's anchor point, because it need to consider offset point, so here is the override function.
+ * @override
+ * @param {cc.Point|Number} point point or x of point
+ * @param {Number} [y] y of point
+ */
setAnchorPoint: function(point, y){
var ax, ay;
if(y !== undefined){
@@ -316,6 +321,11 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
this.setNodeDirty();
},
+ /**
+ * Returns the anchor point in points of ccs.Armature.
+ * @override
+ * @returns {cc.Point}
+ */
getAnchorPointInPoints: function(){
return this._realAnchorPointInPoints;
},
@@ -344,6 +354,11 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
return this._armatureTransformDirty;
},
+ /**
+ * The update callback of ccs.Armature, it updates animation's state and updates bone's state.
+ * @override
+ * @param {Number} dt
+ */
update: function (dt) {
this.animation.update(dt);
var locTopBoneList = this._topBoneList;
@@ -352,6 +367,11 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
this._armatureTransformDirty = false;
},
+ /**
+ * Draws armature's display render node.
+ * @override
+ * @param {CanvasRenderingContext2D | WebGLRenderingContext} ctx The render context
+ */
draw: function(ctx){
if (this._parentBone == null && this._batchNode == null) {
// CC_NODE_DRAW_SETUP();
@@ -408,11 +428,19 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
}
},
+ /**
+ * The callback when ccs.Armature enter stage.
+ * @override
+ */
onEnter: function () {
cc.Node.prototype.onEnter.call(this);
this.scheduleUpdate();
},
+ /**
+ * The callback when ccs.Armature exit stage.
+ * @override
+ */
onExit: function () {
cc.Node.prototype.onExit.call(this);
this.unscheduleUpdate();
@@ -531,7 +559,7 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
},
/**
- * return parent bone
+ * Return parent bone of ccs.Armature.
* @returns {ccs.Bone}
*/
getParentBone: function () {
@@ -559,6 +587,7 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
}
},
+
setBody: function (body) {
if (this._body == body)
return;
@@ -591,7 +620,7 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
},
/**
- * conforms to cc.TextureProtocol protocol
+ * Sets the blendFunc to ccs.Armature
* @param {cc.BlendFunc} blendFunc
*/
setBlendFunc: function (blendFunc) {
@@ -599,7 +628,7 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
},
/**
- * blendFunc getter
+ * Returns the blendFunc of ccs.Armature
* @returns {cc.BlendFunc}
*/
getBlendFunc: function () {
@@ -617,7 +646,7 @@ ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
},
/**
- * Gets the armatureData of this Armature
+ * Returns the armatureData of ccs.Armature
* @return {ccs.ArmatureData}
*/
getArmatureData: function () {
diff --git a/extensions/cocostudio/armature/CCBone.js b/extensions/cocostudio/armature/CCBone.js
index 62e22f604a..8a4d1d78a5 100644
--- a/extensions/cocostudio/armature/CCBone.js
+++ b/extensions/cocostudio/armature/CCBone.js
@@ -24,7 +24,7 @@
****************************************************************************/
/**
- * Base class for ccs.Bone objects.
+ * The Bone of Armature, it has bone data, display manager and transform data for armature.
* @class
* @extends ccs.Node
*
@@ -53,12 +53,16 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
_parentBone: null,
_boneTransformDirty: false,
_worldTransform: null,
- _blendFunc: 0,
+ _blendFunc: null,
blendDirty: false,
_worldInfo: null,
_armatureParentBone: null,
_dataVersion: 0,
_className: "Bone",
+
+ /**
+ * Construction of ccs.Bone.
+ */
ctor: function () {
cc.Node.prototype.ctor.call(this);
this._tweenData = null;
@@ -81,15 +85,14 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * Initializes a CCBone with the specified name
- * @param {String} name
+ * Initializes a ccs.Bone with the specified name
+ * @param {String} name bone name
* @return {Boolean}
*/
init: function (name) {
// cc.Node.prototype.init.call(this);
- if (name) {
+ if (name)
this._name = name;
- }
this._tweenData = new ccs.FrameData();
this._tween = new ccs.Tween();
@@ -105,7 +108,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * set the boneData
+ * Sets the boneData to ccs.Bone.
* @param {ccs.BoneData} boneData
*/
setBoneData: function (boneData) {
@@ -120,7 +123,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * boneData getter
+ * Returns boneData of ccs.Bone.
* @return {ccs.BoneData}
*/
getBoneData: function () {
@@ -128,7 +131,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * set the armature
+ * Sets the armature reference to ccs.Bone.
* @param {ccs.Armature} armature
*/
setArmature: function (armature) {
@@ -137,13 +140,12 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
this._tween.setAnimation(this._armature.getAnimation());
this._dataVersion = this._armature.getArmatureData().dataVersion;
this._armatureParentBone = this._armature.getParentBone();
- } else {
+ } else
this._armatureParentBone = null;
- }
},
/**
- * armature getter
+ * Returns the armature reference of ccs.Bone.
* @return {ccs.Armature}
*/
getArmature: function () {
@@ -151,7 +153,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * update worldTransform
+ * Updates worldTransform by tween data and updates display state
* @param {Number} delta
*/
update: function (delta) {
@@ -179,10 +181,10 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
locWorldInfo.skewY = locTweenData.skewY + this._skewY - this._rotationY;
if(this._parentBone)
- this.applyParentTransform(this._parentBone);
+ this._applyParentTransform(this._parentBone);
else {
if (this._armatureParentBone)
- this.applyParentTransform(this._armatureParentBone);
+ this._applyParentTransform(this._armatureParentBone);
}
ccs.TransformHelp.nodeToMatrix(locWorldInfo, this._worldTransform);
@@ -198,7 +200,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
this._boneTransformDirty = false;
},
- applyParentTransform: function (parent) {
+ _applyParentTransform: function (parent) {
var locWorldInfo = this._worldInfo;
var locParentWorldTransform = parent._worldTransform;
var locParentWorldInfo = parent._worldInfo;
@@ -213,18 +215,29 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * BlendFunc setter
- * @param {cc.BlendFunc} blendFunc
+ * Sets BlendFunc to ccs.Bone.
+ * @param {cc.BlendFunc|Number} blendFunc blendFunc or src of blendFunc
+ * @param {Number} [dst] dst of blendFunc
*/
- setBlendFunc: function (blendFunc) {
- if (this._blendFunc.src != blendFunc.src || this._blendFunc.dst != blendFunc.dst) {
- this._blendFunc = blendFunc;
+ setBlendFunc: function (blendFunc, dst) {
+ var locBlendFunc = this._blendFunc, srcValue, dstValue;
+ if(dst === undefined){
+ srcValue = blendFunc.src;
+ dstValue = blendFunc.dst;
+ } else {
+ srcValue = blendFunc;
+ dstValue = dst;
+ }
+ if (locBlendFunc.src != srcValue || locBlendFunc.dst != dstValue) {
+ locBlendFunc.src = srcValue;
+ locBlendFunc.dst = dstValue;
this.blendDirty = true;
}
},
/**
- * update display color
+ * Updates display color
+ * @override
* @param {cc.Color} color
*/
updateDisplayedColor: function (color) {
@@ -234,7 +247,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * update display opacity
+ * Updates display opacity
* @param {Number} opacity
*/
updateDisplayedOpacity: function (opacity) {
@@ -244,7 +257,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * update display color
+ * Updates display color
*/
updateColor: function () {
var display = this._displayManager.getDisplayRenderNode();
@@ -259,7 +272,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * update display zOrder
+ * Updates display zOrder
*/
updateZOrder: function () {
if (this._armature.getArmatureData().dataVersion >= ccs.CONST_VERSION_COMBINED) {
@@ -271,7 +284,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * Add a child to this bone, and it will let this child call setParent(ccs.Bone) function to set self to it's parent
+ * Adds a child to this bone, and it will let this child call setParent(ccs.Bone) function to set self to it's parent
* @param {ccs.Bone} child
*/
addChildBone: function (child) {
@@ -306,31 +319,34 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * Remove itself from its parent CCBone.
+ * Removes itself from its parent ccs.Bone.
* @param {Boolean} recursion
*/
removeFromParent: function (recursion) {
- if (this._parentBone) {
+ if (this._parentBone)
this._parentBone.removeChildBone(this, recursion);
- }
},
/**
- * Set parent bone.
+ * Sets parent bone to ccs.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).
+ * 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).
* @param {ccs.Bone} parent the parent bone.
*/
setParentBone: function (parent) {
this._parentBone = parent;
},
+ /**
+ * Returns the parent bone of ccs.Bone.
+ * @returns {ccs.Bone}
+ */
getParentBone: function(){
return this._parentBone;
},
/**
- * child armature setter
+ * Sets ccs.Bone's child armature
* @param {ccs.Armature} armature
*/
setChildArmature: function (armature) {
@@ -342,7 +358,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * child armature getter
+ * Returns ccs.Bone's child armature.
* @return {ccs.Armature}
*/
getChildArmature: function () {
@@ -350,7 +366,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * tween getter
+ * Return the tween of ccs.Bone
* @return {ccs.Tween}
*/
getTween: function () {
@@ -358,7 +374,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * zOrder setter
+ * Sets the local zOrder to ccs.Bone.
* @param {Number} zOrder
*/
setLocalZOrder: function (zOrder) {
@@ -366,16 +382,25 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
cc.Node.prototype.setLocalZOrder.call(this, zOrder);
},
+ /**
+ * Return the worldTransform of ccs.Bone.
+ * @returns {cc.AffineTransform}
+ */
getNodeToArmatureTransform: function(){
return this._worldTransform;
},
+ /**
+ * Returns the world transform of ccs.Bone.
+ * @override
+ * @returns {cc.AffineTransform}
+ */
getNodeToWorldTransform: function(){
return cc.affineTransformConcat(this._worldTransform, this._armature.getNodeToWorldTransform());
},
/**
- * get render node
+ * Returns the display render node.
* @returns {cc.Node}
*/
getDisplayRenderNode: function () {
@@ -383,7 +408,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * get render node type
+ * Returns the type of display render node
* @returns {Number}
*/
getDisplayRenderNodeType: function () {
@@ -405,15 +430,16 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * remove display
- * @param {Number} index
+ * Removes display by index.
+ * @param {Number} index display renderer's index
*/
removeDisplay: function (index) {
this._displayManager.removeDisplay(index);
},
/**
- * change display by index
+ * Changes display by index
+ * @deprecated since v3.0, please use changeDisplayWithIndex instead.
* @param {Number} index
* @param {Boolean} force
*/
@@ -422,12 +448,19 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
this.changeDisplayWithIndex(index, force);
},
+ /**
+ * Changes display by name
+ * @deprecated since v3.0, please use changeDisplayWithName instead.
+ * @param {String} name
+ * @param {Boolean} force
+ */
changeDisplayByName: function(name, force){
+ cc.log("changeDisplayByName is deprecated. Use changeDisplayWithName instead.");
this.changeDisplayWithName(name, force);
},
/**
- * change display with index
+ * Changes display with index
* @param {Number} index
* @param {Boolean} force
*/
@@ -436,7 +469,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * change display with name
+ * Changes display with name
* @param {String} name
* @param {Boolean} force
*/
@@ -444,6 +477,10 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
this._displayManager.changeDisplayWithName(name, force);
},
+ /**
+ * Returns the collide detector of ccs.Bone.
+ * @returns {*}
+ */
getColliderDetector: function(){
var decoDisplay = this._displayManager.getCurrentDecorativeDisplay();
if (decoDisplay){
@@ -455,22 +492,21 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * collider filter setter
- * @param {cc.ColliderFilter} filter
+ * Sets collider filter to ccs.Bone.
+ * @param {ccs.ColliderFilter} filter
*/
setColliderFilter: function (filter) {
var displayList = this._displayManager.getDecorativeDisplayList();
for (var i = 0; i < displayList.length; i++) {
var locDecoDisplay = displayList[i];
var locDetector = locDecoDisplay.getColliderDetector();
- if (locDetector) {
+ if (locDetector)
locDetector.setColliderFilter(filter);
- }
}
},
/**
- * collider filter getter
+ * Returns collider filter of ccs.Bone.
* @returns {cc.ColliderFilter}
*/
getColliderFilter: function () {
@@ -484,7 +520,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * transform dirty setter
+ * Sets ccs.Bone's transform dirty flag.
* @param {Boolean} dirty
*/
setTransformDirty: function (dirty) {
@@ -492,7 +528,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * transform dirty getter
+ * Returns ccs.Bone's transform dirty flag whether is dirty.
* @return {Boolean}
*/
isTransformDirty: function () {
@@ -508,7 +544,7 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * When CCArmature play a animation, if there is not a CCMovementBoneData of this bone in this CCMovementData, this bone will hide.
+ * 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.
* @param {Boolean} bool
*/
@@ -516,51 +552,67 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
this._ignoreMovementBoneData = bool;
},
+ /**
+ * Returns whether is ignore movement bone data.
+ * @returns {Boolean}
+ */
isIgnoreMovementBoneData: function(){
return this._ignoreMovementBoneData;
},
/**
- * blendType getter
+ * Returns the blendFunc of ccs.Bone.
* @return {cc.BlendFunc}
*/
getBlendFunc: function () {
return this._blendFunc;
},
+ /**
+ * Sets blend dirty flag
+ * @param {Boolean} dirty
+ */
setBlendDirty: function (dirty) {
this._blendDirty = dirty;
},
+ /**
+ * Returns the blend dirty flag whether is dirty.
+ * @returns {Boolean|*|ccs.Bone._blendDirty}
+ */
isBlendDirty: function () {
return this._blendDirty;
},
/**
- * tweenData getter
+ * Returns the tweenData of ccs.Bone.
* @return {ccs.FrameData}
*/
getTweenData: function () {
return this._tweenData;
},
+ /**
+ * Returns the world information of ccs.Bone.
+ * @returns {ccs.BaseData}
+ */
getWorldInfo: function(){
return this._worldInfo;
},
/**
- * child bone getter
+ * Returns the children of ccs.Bone
* @return {Array}
- * @deprecated
+ * @deprecated since v3.0, please use getChildren instead.
*/
getChildrenBone: function () {
return this._children;
},
/**
- * @deprecated
- * return world transform
- * @return {{a:0.b:0,c:0,d:0,tx:0,ty:0}}
+ * Returns the worldTransform of ccs.Bone.
+ * @return {cc.AffineTransform}
+ * @deprecated since v3.0, please use getNodeToArmatureTransform instead.
*/
nodeToArmatureTransform: function () {
return this.getNodeToArmatureTransform();
@@ -576,9 +628,9 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * @deprecated
- * get the collider body list in this bone.
- * @returns {*}
+ * Returns the collider body list in this bone.
+ * @returns {Array|null}
+ * @deprecated since v3.0, please use getColliderDetector to get a delector, and calls its getColliderBodyList instead.
*/
getColliderBodyList: function () {
var detector = this.getColliderDetector();
@@ -588,8 +640,9 @@ ccs.Bone = ccs.Node.extend(/** @lends ccs.Bone# */{
},
/**
- * ignoreMovementBoneData getter
+ * Returns whether is ignore movement bone data.
* @return {Boolean}
+ * @deprecated since v3.0, please isIgnoreMovementBoneData instead.
*/
getIgnoreMovementBoneData: function () {
return this.isIgnoreMovementBoneData();
@@ -624,8 +677,7 @@ cc.defineGetterSetter(_p, "colliderFilter", _p.getColliderFilter, _p.setCollider
_p = null;
/**
- * allocates and initializes a bone.
- * @constructs
+ * Allocates and initializes a bone.
* @return {ccs.Bone}
* @example
* // example
diff --git a/extensions/cocostudio/armature/animation/CCArmatureAnimation.js b/extensions/cocostudio/armature/animation/CCArmatureAnimation.js
index 272d74c3c1..566e24b24b 100644
--- a/extensions/cocostudio/armature/animation/CCArmatureAnimation.js
+++ b/extensions/cocostudio/armature/animation/CCArmatureAnimation.js
@@ -24,7 +24,8 @@
****************************************************************************/
/**
- * movement event type
+ * movement event type enum
+ * @constant
* @type {Object}
*/
ccs.MovementEventType = {
@@ -32,8 +33,10 @@ ccs.MovementEventType = {
complete: 1,
loopComplete: 2
};
+
/**
- * Base class for cc.MovementEvent objects.
+ * The animation event class, it has the callback, target and arguments.
+ * @deprecated since v3.0.
* @class
* @extends ccs.Class
*/
@@ -43,7 +46,7 @@ ccs.AnimationEvent = ccs.Class.extend(/** @lends ccs.AnimationEvent# */{
_selectorTarget: null,
/**
- *
+ * Constructor of ccs.AnimationEvent
* @param {function} callFunc
* @param {object} target
* @param {object} [data]
@@ -54,26 +57,36 @@ ccs.AnimationEvent = ccs.Class.extend(/** @lends ccs.AnimationEvent# */{
this._selectorTarget = target;
},
call: function () {
- if (this._callFunc) {
+ if (this._callFunc)
this._callFunc.apply(this._selectorTarget, this._arguments);
- }
},
setArguments: function (args) {
this._arguments = args;
}
});
+
/**
- * movement event
+ * The movement event class for Armature.
* @constructor
+ *
+ * @property {ccs.Armature} armature - The armature reference of movement event.
+ * @property {Number} movementType - The type of movement.
+ * @property {String} movementID - The ID of movement.
*/
ccs.MovementEvent = function () {
this.armature = null;
- this.movementType = "";
+ this.movementType = ccs.MovementEventType.start;
this.movementID = "";
};
+
/**
- * frame event
+ * The frame event class for Armature.
* @constructor
+ *
+ * @property {ccs.Bone} bone - The bone reference of frame event.
+ * @property {String} frameEventName - The name of frame event.
+ * @property {Number} originFrameIndex - The index of origin frame.
+ * @property {Number} currentFrameIndex - The index of current frame.
*/
ccs.FrameEvent = function () {
this.bone = null;
@@ -81,8 +94,9 @@ ccs.FrameEvent = function () {
this.originFrameIndex = 0;
this.currentFrameIndex = 0;
};
+
/**
- * Base class for ccs.ArmatureAnimation objects.
+ * The Animation class for Armature, it plays armature animation, and controls speed scale and manages animation frame.
* @class
* @extends ccs.ProcessBase
*
@@ -91,7 +105,6 @@ ccs.FrameEvent = function () {
* @property {Boolean} ignoreFrameEvent - Indicate whether the frame event is ignored
* @property {Number} speedScale - Animation play speed scale
* @property {Number} animationScale - Animation play speed scale
- *
*/
ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# */{
_animationData: null,
@@ -117,6 +130,9 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
_movementEventListener: null,
_frameEventListener: null,
+ /**
+ * The Construction of ccs.ArmatureAnimation
+ */
ctor: function () {
ccs.ProcessBase.prototype.ctor.call(this);
@@ -127,7 +143,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
},
/**
- * init with a CCArmature
+ * Initializes with an armature object
* @param {ccs.Armature} armature
* @return {Boolean}
*/
@@ -137,6 +153,9 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
return true;
},
+ /**
+ * Pauses armature animation.
+ */
pause: function () {
var locTweenList = this._tweenList;
for (var i = 0; i < locTweenList.length; i++)
@@ -144,6 +163,9 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
ccs.ProcessBase.prototype.pause.call(this);
},
+ /**
+ * Resumes armature animation.
+ */
resume: function () {
var locTweenList = this._tweenList;
for (var i = 0; i < locTweenList.length; i++)
@@ -151,6 +173,9 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
ccs.ProcessBase.prototype.resume.call(this);
},
+ /**
+ * Stops armature animation.
+ */
stop: function () {
var locTweenList = this._tweenList;
for (var i = 0; i < locTweenList.length; i++)
@@ -159,16 +184,26 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
ccs.ProcessBase.prototype.stop.call(this);
},
+ /**
+ * Sets animation play speed scale.
+ * @deprecated since v3.0, please use setSpeedScale instead.
+ * @param {Number} animationScale
+ */
setAnimationScale: function (animationScale) {
- return this.setSpeedScale(animationScale);
+ this.setSpeedScale(animationScale);
},
+ /**
+ * Returns animation play speed scale.
+ * @deprecated since v3.0, please use getSpeedScale instead.
+ * @returns {Number}
+ */
getAnimationScale: function () {
return this.getSpeedScale();
},
/**
- * scale animation play speed
+ * Sets animation play speed scale.
* @param {Number} speedScale
*/
setSpeedScale: function (speedScale) {
@@ -185,6 +220,10 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
}
},
+ /**
+ * Returns animation play speed scale.
+ * @returns {Number}
+ */
getSpeedScale: function () {
return this._speedScale;
},
@@ -266,12 +305,13 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
},
/**
- * Play animation with index, the o ther param is the same to play.
+ * Plays animation with index, the other param is the same to play.
* @param {Number} animationIndex
* @param {Number} durationTo
* @param {Number} durationTween
* @param {Number} loop
- * @param {Number} tweenEasing
+ * @param {Number} [tweenEasing]
+ * @deprecated since v3.0, please use playWithIndex instead.
*/
playByIndex: function (animationIndex, durationTo, durationTween, loop, tweenEasing) {
cc.log("playByIndex is deprecated. Use playWithIndex instead.");
@@ -279,8 +319,8 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
},
/**
- * Play animation with index, the other param is the same to play.
- * @param {Number||Array} animationIndex
+ * Plays animation with index, the other param is the same to play.
+ * @param {Number|Array} animationIndex
* @param {Number} durationTo
* @param {Number} loop
*/
@@ -293,7 +333,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
},
/**
- * play with names
+ * Plays animation with names
* @param {Array} movementNames
* @param {Number} durationTo
* @param {Boolean} loop
@@ -310,13 +350,12 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
this._movementList = movementNames;
else
this._movementList.length = 0;
-
this.updateMovementList();
},
/**
- * play by indexes
- * @param movementIndexes
+ * Plays animation by indexes
+ * @param {Array} movementIndexes
* @param {Number} durationTo
* @param {Boolean} loop
*/
@@ -341,14 +380,16 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
},
/**
- * Go to specified frame and play current movement.
- * You need first switch to the movement you want to play, then call this function.
- *
- * example : playByIndex(0);
- * gotoAndPlay(0);
- * playByIndex(1);
- * gotoAndPlay(0);
- * gotoAndPlay(15);
+ *
+ * Goes to specified frame and plays current movement.
+ * You need first switch to the movement you want to play, then call this function.
+ *
+ * example : playByIndex(0);
+ * gotoAndPlay(0);
+ * playByIndex(1);
+ * gotoAndPlay(0);
+ * gotoAndPlay(15);
+ *