From 615ae8cc18627d352e71cd228c498e8475e43825 Mon Sep 17 00:00:00 2001
From: knoxHuang <821686174@qq.com>
Date: Tue, 22 Mar 2016 11:46:43 +0800
Subject: [PATCH 1/2] update actions all api.
---
cocos2d/actions/CCAction.js | 65 ++++++---
cocos2d/actions/CCActionCatmullRom.js | 15 ++-
cocos2d/actions/CCActionEase.js | 185 +++++++++++++++++++++++---
cocos2d/actions/CCActionInstant.js | 34 +++--
cocos2d/actions/CCActionInterval.js | 85 +++++++++---
5 files changed, 310 insertions(+), 74 deletions(-)
diff --git a/cocos2d/actions/CCAction.js b/cocos2d/actions/CCAction.js
index 1c7b8f9fd7..67a727990b 100644
--- a/cocos2d/actions/CCAction.js
+++ b/cocos2d/actions/CCAction.js
@@ -29,7 +29,8 @@
*/
/**
- * Base class cc.Action for action classes.
+ * !#en Base class cc.Action for action classes.
+ * !#zh Action 类是所有动作类型的基类。
* @class Action
*/
cc.Action = cc._Class.extend({
@@ -43,8 +44,10 @@ cc.Action = cc._Class.extend({
},
/**
+ * !#en
* to copy object with deep copy.
* returns a clone of action.
+ * !#zh 返回一个克隆的动作。
* @method clone
* @return {Action}
*/
@@ -57,7 +60,9 @@ cc.Action = cc._Class.extend({
},
/**
+ * !#en
* return true if the action has finished.
+ * !#zh 如果动作已完成就返回 true。
* @method isDone
* @return {Boolean}
*/
@@ -87,7 +92,8 @@ cc.Action = cc._Class.extend({
},
/**
- * get the target.
+ * !#en get the target.
+ * !#zh 获取当前目标节点。
* @method getTarget
* @return {Node}
*/
@@ -96,7 +102,8 @@ cc.Action = cc._Class.extend({
},
/**
- * The action will modify the target properties.
+ * !#en The action will modify the target properties.
+ * !#zh 设置目标节点属性。
* @method setTarget
* @param {Node} target
*/
@@ -105,7 +112,8 @@ cc.Action = cc._Class.extend({
},
/**
- * get the original target.
+ * !#en get the original target.
+ * !#zh 获取原始目标节点。
* @method getOriginalTarget
* @return {Node}
*/
@@ -121,7 +129,8 @@ cc.Action = cc._Class.extend({
},
/**
- * get tag number.
+ * !#en get tag number.
+ * !#zh 获取一个用于识别动作的标签。
* @method getTag
* @return {Number}
*/
@@ -130,7 +139,8 @@ cc.Action = cc._Class.extend({
},
/**
- * set tag number.
+ * !#en set tag number.
+ * !#zh 设置标签,用于识别动作。
* @method setTag
* @param {Number} tag
*/
@@ -151,21 +161,27 @@ cc.Action = cc._Class.extend({
}
});
-/** Default Action tag
+/**
+ * !#en Default Action tag.
+ * !#zh 默认动作标签。
+ * @property TAG_INVALID
* @constant
+ * @static
* @type {Number}
- * @default
+ * @default -1
*/
cc.Action.TAG_INVALID = -1;
/**
+ * !#en
* Base class actions that do have a finite time duration.
* Possible actions:
* - An action with a duration of 0 seconds.
* - An action with a duration of 35.5 seconds.
*
* Infinite time actions are valid
+ * !#zh 有限时间动作,这种动作拥有时长 duration 属性。
* @class FiniteTimeAction
* @extends Action
*/
@@ -179,7 +195,8 @@ cc.FiniteTimeAction = cc.Action.extend({
},
/**
- * get duration of the action. (seconds)
+ * !#en get duration of the action. (seconds).
+ * !#zh 获取动作以秒为单位的持续时间。
* @method getDuration
* @return {Number}
*/
@@ -188,7 +205,8 @@ cc.FiniteTimeAction = cc.Action.extend({
},
/**
- * set duration of the action. (seconds)
+ * !#en set duration of the action. (seconds).
+ * !#zh 设置动作以秒为单位的持续时间。
* @method setDuration
* @param {Number} duration
*/
@@ -197,11 +215,13 @@ cc.FiniteTimeAction = cc.Action.extend({
},
/**
+ * !#en
* Returns a reversed action.
* For example:
* - The action will be x coordinates of 0 move to 100.
* - The reversed action will be x of 100 move to 0.
* - Will be rewritten
+ * !#zh 返回一个新的动作,执行与原动作完全相反的动作。
* @method reverse
* @return {Null}
*/
@@ -211,8 +231,10 @@ cc.FiniteTimeAction = cc.Action.extend({
},
/**
+ * !#en
* to copy object with deep copy.
* returns a clone of action.
+ * !#zh 返回一个克隆的动作。
* @method clone
* @return {FiniteTimeAction}
*/
@@ -249,7 +271,7 @@ cc.Speed = cc.Action.extend({
action && this.initWithAction(action, speed);
},
- /**
+ /*
* Gets the current running speed.
* Will get a percentage number, compared to the original speed.
*
@@ -260,7 +282,7 @@ cc.Speed = cc.Action.extend({
return this._speed;
},
- /**
+ /*
* alter the speed of the inner function in runtime.
* @method setSpeed
* @param {Number} speed
@@ -269,7 +291,7 @@ cc.Speed = cc.Action.extend({
this._speed = speed;
},
- /**
+ /*
* initializes the action.
* @method initWithAction
* @param {ActionInterval} action
@@ -313,7 +335,7 @@ cc.Speed = cc.Action.extend({
return new cc.Speed(this._innerAction.reverse(), this._speed);
},
- /**
+ /*
* Set inner Action.
* @method setInnerAction
* @param {ActionInterval} action
@@ -324,7 +346,7 @@ cc.Speed = cc.Action.extend({
}
},
- /**
+ /*
* Get inner Action.
* @method getInnerAction
* @return {ActionInterval}
@@ -339,16 +361,21 @@ cc.Speed = cc.Action.extend({
*/
/**
+ * !#en
* Creates the speed action which changes the speed of an action, making it take longer (speed > 1)
* or less (speed < 1) time.
* Useful to simulate 'slow motion' or 'fast forward' effect.
- *
+ * !#zh 修改目标动作的速率。
* @warning This action can't be Sequenceable because it is not an cc.IntervalAction
*
* @method speed
* @param {ActionInterval} action
* @param {Number} speed
* @return {Action}
+ * @example
+ * // change the target action speed;
+ * var action = cc.scaleTo(0.2, 1, 0.6);
+ * var newAction = cc.speed(action, 0.5);
*/
cc.speed = function (action, speed) {
return new cc.Speed(action, speed);
@@ -400,7 +427,7 @@ cc.Follow = cc.Action.extend({
topBoundary:0.0,
bottomBoundary:0.0,
- /**
+ /*
* Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
* creates the action with a set boundary.
* creates the action with no boundary set.
@@ -528,8 +555,8 @@ cc.Follow = cc.Action.extend({
});
/**
- * Create a follow action which makes its target follows another node.
- *
+ * !#en Create a follow action which makes its target follows another node.
+ * !#zh 追踪目标节点的位置。
* @method follow
* @param {Node} followedNode
* @param {Rect} rect
diff --git a/cocos2d/actions/CCActionCatmullRom.js b/cocos2d/actions/CCActionCatmullRom.js
index d7ee983e17..123f62a528 100644
--- a/cocos2d/actions/CCActionCatmullRom.js
+++ b/cocos2d/actions/CCActionCatmullRom.js
@@ -268,8 +268,8 @@ cc.CardinalSplineTo = cc.ActionInterval.extend({
});
/**
- * creates an action with a Cardinal Spline array of points and tension.
- *
+ * !#en Creates an action with a Cardinal Spline array of points and tension.
+ * !#zh 按基数样条曲线轨迹移动到目标位置。
* @method cardinalSplineTo
* @param {Number} duration
* @param {Array} points array of control points
@@ -378,8 +378,8 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend({
});
/**
- * creates an action with a Cardinal Spline array of points and tension.
- *
+ * !#en Creates an action with a Cardinal Spline array of points and tension.
+ * !#zh 按基数样条曲线轨迹移动指定的距离。
* @method cardinalSplineBy
* @param {Number} duration
* @param {Array} points
@@ -430,8 +430,8 @@ cc.CatmullRomTo = cc.CardinalSplineTo.extend({
});
/**
- * creates an action with a Cardinal Spline array of points and tension.
- *
+ * !#en Creates an action with a Cardinal Spline array of points and tension.
+ * !#zh 按 Catmull Rom 样条曲线轨迹移动到目标位置。
* @method catmullRomTo
* @param {Number} dt
* @param {Array} points
@@ -485,7 +485,8 @@ cc.CatmullRomBy = cc.CardinalSplineBy.extend({
});
/**
- * Creates an action with a Cardinal Spline array of points and tension
+ * !#en Creates an action with a Cardinal Spline array of points and tension.
+ * !#zh 按 Catmull Rom 样条曲线轨迹移动指定的距离。
* @method catmullRomBy
* @param {Number} dt
* @param {Array} points
diff --git a/cocos2d/actions/CCActionEase.js b/cocos2d/actions/CCActionEase.js
index 0777104624..fe147af550 100644
--- a/cocos2d/actions/CCActionEase.js
+++ b/cocos2d/actions/CCActionEase.js
@@ -29,7 +29,8 @@
*/
/**
- * Base class for Easing actions
+ * !#en Base class for Easing actions.
+ * !#zh 所有缓动动作基类,用于修饰 ActionInterval。
* @class ActionEase
* @extends ActionInterval
* @param {ActionInterval} action
@@ -98,8 +99,8 @@ cc.actionEase = function (action) {
};
/**
- * Base class for Easing actions with rate parameters
- *
+ * !#en Base class for Easing actions with rate parameters
+ * !#zh 拥有速率属性的缓动动作基类。
* @class EaseRateAction
* @extends ActionEase
* @param {ActionInterval} action
@@ -191,9 +192,10 @@ cc.EaseIn = cc.EaseRateAction.extend({
});
/**
+ * !#en
* Creates the action easing object with the rate parameter.
* From slow to fast.
- *
+ * !#zh 创建 easeIn 缓动对象,由慢到快。
* @method easeIn
* @param {Number} rate
* @return {Object}
@@ -241,9 +243,10 @@ cc.EaseOut = cc.EaseRateAction.extend({
});
/**
+ * !#en
* Creates the action easing object with the rate parameter.
* From fast to slow.
- *
+ * !#zh 创建 easeOut 缓动对象,由快到慢。
* @method easeOut
* @param {Number} rate
* @return {Object}
@@ -295,8 +298,10 @@ cc.EaseInOut = cc.EaseRateAction.extend({
});
/**
+ * !#en
* Creates the action easing object with the rate parameter.
* Slow to fast then to slow.
+ * !#zh 创建 easeInOut 缓动对象,慢到快,然后慢。
* @method easeInOut
* @param {Number} rate
* @return {Object}
@@ -359,9 +364,14 @@ cc._easeExponentialInObj = {
};
/**
+ * !#en
* Creates the action easing object with the rate parameter.
* Reference easeInExpo:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeExponentialIn 缓动对象。
+ * EaseExponentialIn 是按指数函数缓动进入的动作。
+ * 参考 easeInExpo:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeExponentialIn
* @return {Object}
* @example
@@ -410,9 +420,14 @@ cc._easeExponentialOutObj = {
};
/**
- * creates the action easing object.
+ * !#en
+ * Creates the action easing object.
* Reference easeOutExpo:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeExponentialOut 缓动对象。
+ * EaseExponentialOut 是按指数函数缓动退出的动作。
+ * 参考 easeOutExpo:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeExponentialOut
* @return {Object}
* @example
@@ -476,9 +491,14 @@ cc._easeExponentialInOutObj = {
};
/**
- * creates an EaseExponentialInOut action easing object.
+ * !#en
+ * Creates an EaseExponentialInOut action easing object.
* Reference easeInOutExpo:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeExponentialInOut 缓动对象。
+ * EaseExponentialInOut 是按指数函数缓动进入并退出的动作。
+ * 参考 easeInOutExpo:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeExponentialInOut
* @return {Object}
* @example
@@ -527,9 +547,14 @@ cc._easeSineInObj = {
}
};
/**
- * creates an EaseSineIn action.
+ * !#en
+ * Creates an EaseSineIn action.
* Reference easeInSine:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 EaseSineIn 缓动对象。
+ * EaseSineIn 是按正弦函数缓动进入的动作。
+ * 参考 easeInSine:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeSineIn
* @return {Object}
* @example
@@ -579,9 +604,14 @@ cc._easeSineOutObj = {
};
/**
+ * !#en
* Creates an EaseSineOut action easing object.
* Reference easeOutSine:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 EaseSineOut 缓动对象。
+ * EaseSineIn 是按正弦函数缓动退出的动作。
+ * 参考 easeOutSine:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeSineOut
* @return {Object}
* @example
@@ -631,9 +661,14 @@ cc._easeSineInOutObj = {
};
/**
- * creates the action easing object.
+ * !#en
+ * Creates the action easing object.
* Reference easeInOutSine:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeSineInOut 缓动对象。
+ * EaseSineIn 是按正弦函数缓动进入并退出的动作。
+ * 参考 easeInOutSine:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeSineInOut
* @return {Object}
* @example
@@ -645,11 +680,12 @@ cc.easeSineInOut = function(){
};
/**
- * Ease Elastic abstract class.
+ * !#en Ease Elastic abstract class.
+ * !#zh 弹性缓动动作基类。
* @class EaseElastic
* @extends ActionEase
* @param {ActionInterval} action
- * @param {Number} [period=0.3]
+ * @param {Number} period
*/
cc.EaseElastic = cc.ActionEase.extend({
_period: 0.3,
@@ -755,11 +791,16 @@ cc._easeElasticInObj = {
};
/**
+ * !#en
* Creates the action easing obejct with the period in radians (default is 0.3).
* Reference easeInElastic:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeElasticIn 缓动对象。
+ * EaseElasticIn 是按弹性曲线缓动进入的动作。
+ * 参数 easeInElastic:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeElasticIn
- * @param {Number} [period=0.3]
+ * @param {Number} period
* @return {Object}
* @example
* // example
@@ -830,11 +871,16 @@ cc._easeElasticOutObj = {
}
};
/**
+ * !#en
* Creates the action easing object with the period in radians (default is 0.3).
* Reference easeOutElastic:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeElasticOut 缓动对象。
+ * EaseElasticOut 是按弹性曲线缓动退出的动作。
+ * 参考 easeOutElastic:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeElasticOut
- * @param {Number} [period=0.3]
+ * @param {Number} period
* @return {Object}
* @example
* // example
@@ -901,11 +947,16 @@ cc.EaseElasticInOut = cc.EaseElastic.extend({
});
/**
+ * !#en
* Creates the action easing object with the period in radians (default is 0.3).
* Reference easeInOutElastic:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeElasticInOut 缓动对象。
+ * EaseElasticInOut 是按弹性曲线缓动进入并退出的动作。
+ * 参考 easeInOutElastic:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeElasticInOut
- * @param {Number} [period=0.3]
+ * @param {Number} period
* @return {Object}
* @example
* // example
@@ -940,8 +991,8 @@ cc.easeElasticInOut = function (period) {
};
/**
- * cc.EaseBounce abstract class.
- *
+ * !#en cc.EaseBounce abstract class.
+ * !#zh 反弹缓动动作基类。
* @class EaseBounce
* @extends ActionEase
*/
@@ -1034,8 +1085,12 @@ cc._easeBounceInObj = {
};
/**
+ * !#en
* Creates the action easing object.
* Eased bounce effect at the beginning.
+ * !#zh
+ * 创建 easeBounceIn 缓动对象。
+ * EaseBounceIn 是按弹跳动作缓动进入的动作。
* @method easeBounceIn
* @return {Object}
* @example
@@ -1085,8 +1140,12 @@ cc._easeBounceOutObj = {
};
/**
+ * !#en
* Creates the action easing object.
* Eased bounce effect at the ending.
+ * !#zh
+ * 创建 easeBounceOut 缓动对象。
+ * EaseBounceOut 是按弹跳动作缓动退出的动作。
* @method easeBounceOut
* @return {Object}
* @example
@@ -1149,8 +1208,12 @@ cc._easeBounceInOutObj = {
};
/**
+ * !#en
* Creates the action easing object.
* Eased bounce effect at the begining and ending.
+ * !#zh
+ * 创建 easeBounceInOut 缓动对象。
+ * EaseBounceInOut 是按弹跳动作缓动进入并退出的动作。
* @method easeBounceInOut
* @return {Object}
* @example
@@ -1202,8 +1265,12 @@ cc._easeBackInObj = {
};
/**
+ * !#en
* Creates the action easing object.
* In the opposite direction to move slowly, and then accelerated to the right direction.
+ * !#zh
+ * 创建 easeBackIn 缓动对象。
+ * easeBackIn 是在相反的方向缓慢移动,然后加速到正确的方向。
* @method easeBackIn
* @return {Object}
* @example
@@ -1256,8 +1323,12 @@ cc._easeBackOutObj = {
};
/**
+ * !#en
* Creates the action easing object.
* Fast moving more than the finish, and then slowly back to the finish.
+ * !#zh
+ * 创建 easeBackOut 缓动对象。
+ * easeBackOut 快速移动超出目标,然后慢慢回到目标点。
* @method easeBackOut
* @return {Object}
* @example
@@ -1320,8 +1391,11 @@ cc._easeBackInOutObj = {
};
/**
+ * !#en
* Creates the action easing object.
* Begining of cc.EaseBackIn. Ending of cc.EaseBackOut.
+ * !#zh
+ * 创建 easeBackInOut 缓动对象。
* @method easeBackInOut
* @return {Object}
* @example
@@ -1399,9 +1473,13 @@ cc.EaseBezierAction = cc.ActionEase.extend({
});
/**
+ * !#en
* Creates the action easing object.
* Into the 4 reference point.
* To calculate the motion curve.
+ * !#zh
+ * 创建 easeBezierAction 缓动对象。
+ * EaseBezierAction 是按贝塞尔曲线缓动的动作。
* @method easeBezierAction
* @param {Number} p0 The first bezier parameter
* @param {Number} p1 The second bezier parameter
@@ -1465,9 +1543,14 @@ cc._easeQuadraticActionIn = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInQuad:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuadraticActionIn 缓动对象。
+ * EaseQuadraticIn是按二次函数缓动进入的动作。
+ * 参考 easeInQuad:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuadraticActionIn
* @returns {Object}
* @example
@@ -1518,9 +1601,14 @@ cc._easeQuadraticActionOut = {
}
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeOutQuad:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuadraticActionOut 缓动对象。
+ * EaseQuadraticOut 是按二次函数缓动退出的动作。
+ * 参考 easeOutQuad:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuadraticActionOut
* @returns {Object}
* @example
@@ -1579,9 +1667,14 @@ cc._easeQuadraticActionInOut = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInOutQuad:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuadraticActionInOut 缓动对象。
+ * EaseQuadraticInOut 是按二次函数缓动进入并退出的动作。
+ * 参考 easeInOutQuad:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuadraticActionInOut
* @returns {Object}
* @example
@@ -1631,9 +1724,14 @@ cc._easeQuarticActionIn = {
}
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeIntQuart:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuarticActionIn 缓动对象。
+ * EaseQuarticIn 是按四次函数缓动进入的动作。
+ * 参考 easeIntQuart:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuarticActionIn
* @returns {Object}
* @example
@@ -1685,9 +1783,14 @@ cc._easeQuarticActionOut = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeOutQuart:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuarticActionOut 缓动对象。
+ * EaseQuarticOut 是按四次函数缓动退出的动作。
+ * 参考 easeOutQuart:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuarticActionOut
* @returns {Object}
* @example
@@ -1741,9 +1844,14 @@ cc._easeQuarticActionInOut = {
}
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInOutQuart:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuarticActionInOut 缓动对象。
+ * EaseQuarticInOut 是按四次函数缓动进入并退出的动作。
+ * 参考 easeInOutQuart:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuarticActionInOut
* @returns {Object}
*/
@@ -1791,9 +1899,14 @@ cc._easeQuinticActionIn = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInQuint:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuinticActionIn 缓动对象。
+ * EaseQuinticIn 是按五次函数缓动进的动作。
+ * 参考 easeInQuint:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuinticActionIn
* @returns {Object}
* @example
@@ -1845,9 +1958,14 @@ cc._easeQuinticActionOut = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeOutQuint:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuinticActionOut 缓动对象。
+ * EaseQuinticOut 是按五次函数缓动退出的动作
+ * 参考 easeOutQuint:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuinticActionOut
* @returns {Object}
* @example
@@ -1902,9 +2020,14 @@ cc._easeQuinticActionInOut = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInOutQuint:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeQuinticActionInOut 缓动对象。
+ * EaseQuinticInOut是按五次函数缓动进入并退出的动作。
+ * 参考 easeInOutQuint:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeQuinticActionInOut
* @returns {Object}
* @example
@@ -1955,9 +2078,14 @@ cc._easeCircleActionIn = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInCirc:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeCircleActionIn 缓动对象。
+ * EaseCircleIn是按圆形曲线缓动进入的动作。
+ * 参考 easeInCirc:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeCircleActionIn
* @returns {Object}
* @example
@@ -2009,9 +2137,14 @@ cc._easeCircleActionOut = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeOutCirc:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeCircleActionOut 缓动对象。
+ * EaseCircleOut是按圆形曲线缓动退出的动作。
+ * 参考 easeOutCirc:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeCircleActionOut
* @returns {Object}
* @exampple
@@ -2066,9 +2199,14 @@ cc._easeCircleActionInOut = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInOutCirc:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeCircleActionInOut 缓动对象。
+ * EaseCircleInOut 是按圆形曲线缓动进入并退出的动作。
+ * 参考 easeInOutCirc:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeCircleActionInOut
* @returns {Object}
* @example
@@ -2119,9 +2257,14 @@ cc._easeCubicActionIn = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInCubic:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeCubicActionIn 缓动对象。
+ * EaseCubicIn 是按三次函数缓动进入的动作。
+ * 参考 easeInCubic:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeCubicActionIn
* @returns {Object}
* @example
@@ -2173,9 +2316,14 @@ cc._easeCubicActionOut = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeOutCubic:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeCubicActionOut 缓动对象。
+ * EaseCubicOut 是按三次函数缓动退出的动作。
+ * 参考 easeOutCubic:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeCubicActionOut
* @returns {Object}
* @example
@@ -2230,9 +2378,14 @@ cc._easeCubicActionInOut = {
};
/**
+ * !#en
* Creates the action easing object.
* Reference easeInOutCubic:
* http://www.zhihu.com/question/21981571/answer/19925418
+ * !#zh
+ * 创建 easeCubicActionInOut 缓动对象。
+ * EaseCubicInOut是按三次函数缓动进入并退出的动作。
+ * 参考 easeInOutCubic:http://www.zhihu.com/question/21981571/answer/19925418
* @method easeCubicActionInOut
* @returns {Object}
*/
diff --git a/cocos2d/actions/CCActionInstant.js b/cocos2d/actions/CCActionInstant.js
index b5679ec581..d5b990887b 100644
--- a/cocos2d/actions/CCActionInstant.js
+++ b/cocos2d/actions/CCActionInstant.js
@@ -29,7 +29,8 @@
*/
/**
- * Instant actions are immediate actions. They don't have a duration like the ActionInterval actions.
+ * !#en Instant actions are immediate actions. They don't have a duration like the ActionInterval actions.
+ * !#zh 即时动作,这种动作立即就会执行,继承自 FiniteTimeAction。
* @class ActionInstant
* @extends FiniteTimeAction
*/
@@ -87,7 +88,8 @@ cc.Show = cc.ActionInstant.extend({
});
/**
- * Show the Node.
+ * !#en Show the Node.
+ * !#zh 立即显示。
* @method show
* @return {ActionInstant}
* @example
@@ -119,7 +121,8 @@ cc.Hide = cc.ActionInstant.extend({
});
/**
- * Hide the node.
+ * !#en Hide the node.
+ * !#zh 立即隐藏。
* @method hide
* @return {ActionInstant}
* @example
@@ -151,7 +154,8 @@ cc.ToggleVisibility = cc.ActionInstant.extend({
});
/**
- * Toggles the visibility of a node.
+ * !#en Toggles the visibility of a node.
+ * !#zh 显隐状态切换。
* @method toggleVisibility
* @return {ActionInstant}
* @example
@@ -166,7 +170,7 @@ cc.toggleVisibility = function () {
* Delete self in the next frame.
* @class RemoveSelf
* @extends ActionInstant
- * @param {Boolean} [isNeedCleanUp=true]
+ * @param {Boolean} isNeedCleanUp
*
* @example
* // example
@@ -200,10 +204,10 @@ cc.RemoveSelf = cc.ActionInstant.extend({
});
/**
- * Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.
- *
+ * !#en Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.
+ * !#zh 从父节点移除自身。
* @method removeSelf
- * @param {Boolean} [isNeedCleanUp=true]
+ * @param {Boolean} isNeedCleanUp
* @return {ActionInstant}
*
* @example
@@ -258,8 +262,8 @@ cc.FlipX = cc.ActionInstant.extend({
});
/**
- * Create a FlipX action to flip or unflip the target.
- *
+ * !#en Create a FlipX action to flip or unflip the target.
+ * !#zh X轴翻转。
* @method flipX
* @param {Boolean} flip Indicate whether the target should be flipped or not
* @return {ActionInstant}
@@ -314,8 +318,8 @@ cc.FlipY = cc.ActionInstant.extend({
});
/**
- * Create a FlipY action to flip or unflip the target.
- *
+ * !#en Create a FlipY action to flip or unflip the target.
+ * !#zh Y轴翻转。
* @method flipY
* @param {Boolean} flip
* @return {ActionInstant}
@@ -378,7 +382,8 @@ cc.Place = cc.ActionInstant.extend({
});
/**
- * Creates a Place action with a position.
+ * !#en Creates a Place action with a position.
+ * !#zh 放置在目标位置。
* @method place
* @param {Vec2|Number} pos
* @param {Number} [y]
@@ -487,7 +492,8 @@ cc.CallFunc = cc.ActionInstant.extend({
});
/**
- * Creates the action with the callback
+ * !#en Creates the action with the callback.
+ * !#zh 执行回调函数。
* @method callFunc
* @param {function} selector
* @param {object|null} [selectorTarget]
diff --git a/cocos2d/actions/CCActionInterval.js b/cocos2d/actions/CCActionInterval.js
index 12a3327062..1fbcf94d2a 100644
--- a/cocos2d/actions/CCActionInterval.js
+++ b/cocos2d/actions/CCActionInterval.js
@@ -29,6 +29,7 @@
*/
/**
+ * !#en
*
An interval action is an action that takes place within a certain period of time.
* It has an start time, and a finish time. The finish time is the parameter
* duration plus the start time.
For example, you can simulate a Ping Pong effect running the action normally and
* then running it again in Reverse mode.