diff --git a/cocos2d/actions/CCAction.js b/cocos2d/actions/CCAction.js
index a1de81b5f4..0d62a26c42 100644
--- a/cocos2d/actions/CCAction.js
+++ b/cocos2d/actions/CCAction.js
@@ -24,6 +24,10 @@
THE SOFTWARE.
****************************************************************************/
+/**
+ * @module actions
+ */
+
/** Default Action tag
* @constant
* @type {Number}
@@ -32,16 +36,12 @@
cc.ACTION_TAG_INVALID = -1;
/**
- * Base class for cc.Action objects.
- * @class
+ * Base class cc.Action for action classes.
+ * @class Action
*
- * @extends cc._Class
- *
- * @property {_ccsg.Node} target - The target will be set with the 'startWithTarget' method. When the 'stop' method is called, target will be set to nil.
- * @property {_ccsg.Node} originalTarget - The original target of the action.
- * @property {Number} tag - The tag of the action, can be used to find the action.
+ * @extends _Class
*/
-cc.Action = cc._Class.extend(/** @lends cc.Action# */{
+cc.Action = cc._Class.extend({
//***********variables*************
originalTarget:null,
target:null,
@@ -49,32 +49,17 @@ cc.Action = cc._Class.extend(/** @lends cc.Action# */{
//**************Public Functions***********
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- */
ctor:function () {
this.originalTarget = null;
this.target = null;
this.tag = cc.ACTION_TAG_INVALID;
},
- /**
- * to copy object with deep copy.
- *
- * @deprecated since v3.0 please use .clone
- *
- * @return {cc.Action}
- */
- copy:function () {
- cc.log("copy is deprecated. Please use clone instead.");
- return this.clone();
- },
-
/**
* to copy object with deep copy.
* returns a clone of action.
- *
- * @return {cc.Action}
+ * @method clone
+ * @return {Action}
*/
clone:function () {
var action = new cc.Action();
@@ -86,54 +71,38 @@ cc.Action = cc._Class.extend(/** @lends cc.Action# */{
/**
* return true if the action has finished.
- *
+ * @method isDone
* @return {Boolean}
*/
isDone:function () {
return true;
},
- /**
- * called before the action start. It will also set the target.
- *
- * @param {_ccsg.Node} target
- */
+ // called before the action start. It will also set the target.
startWithTarget:function (target) {
this.originalTarget = target;
this.target = target;
},
- /**
- * called after the action has finished. It will set the 'target' to nil.
- * IMPORTANT: You should never call "action stop" manually. Instead, use: "target.stopAction(action);"
- */
+ // called after the action has finished. It will set the 'target' to nil.
stop:function () {
this.target = null;
},
- /**
- * called every frame with it's delta time.
- * DON'T override unless you know what you are doing.
- *
- * @param {Number} dt
- */
+ // called every frame with it's delta time.
step:function (dt) {
cc.log("[Action step]. override me");
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+ // Called once per frame. Time is the number of seconds of a frame interval.
update:function (dt) {
cc.log("[Action update]. override me");
},
/**
* get the target.
- *
- * @return {_ccsg.Node}
+ * @method getTarget
+ * @return {Node}
*/
getTarget:function () {
return this.target;
@@ -141,8 +110,8 @@ cc.Action = cc._Class.extend(/** @lends cc.Action# */{
/**
* The action will modify the target properties.
- *
- * @param {_ccsg.Node} target
+ * @method setTarget
+ * @param {Node} target
*/
setTarget:function (target) {
this.target = target;
@@ -150,26 +119,23 @@ cc.Action = cc._Class.extend(/** @lends cc.Action# */{
/**
* get the original target.
- *
- * @return {_ccsg.Node}
+ * @method getOriginalTarget
+ * @return {Node}
*/
getOriginalTarget:function () {
return this.originalTarget;
},
- /**
- * Set the original target, since target can be nil.
- * Is the target that were used to run the action.
- * Unless you are doing something complex, like cc.ActionManager, you should NOT call this method.
- * The target is 'assigned', it is not 'retained'.
- * @param {_ccsg.Node} originalTarget
- */
+ // Set the original target, since target can be nil.
+ // Is the target that were used to run the action.
+ // Unless you are doing something complex, like cc.ActionManager, you should NOT call this method.
setOriginalTarget:function (originalTarget) {
this.originalTarget = originalTarget;
},
/**
* get tag number.
+ * @method getTag
* @return {Number}
*/
getTag:function () {
@@ -178,52 +144,30 @@ cc.Action = cc._Class.extend(/** @lends cc.Action# */{
/**
* set tag number.
+ * @method setTag
* @param {Number} tag
*/
setTag:function (tag) {
this.tag = tag;
},
- /**
- * Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB,
- * and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB.
- * This is a hack, and should be removed once JSB fixes the retain/release bug.
- */
+ // Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB,
+ // and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB.
+ // This is a hack, and should be removed once JSB fixes the retain/release bug.
retain:function () {
},
- /**
- * Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB,
- * and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB.
- * This is a hack, and should be removed once JSB fixes the retain/release bug.
- */
+ // Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB,
+ // and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB.
+ // This is a hack, and should be removed once JSB fixes the retain/release bug.
release:function () {
}
});
-/**
- * Allocates and initializes the action.
- *
- * @function cc.action
- * @static
- * @return {cc.Action}
- *
- * @example
- * // return {cc.Action}
- * var action = cc.action();
- */
cc.action = function () {
return new cc.Action();
};
-/**
- * Please use cc.action instead.
- * Allocates and initializes the action.
- *
- * @deprecated since v3.0 please use cc.action() instead.
- * @static
- * @returns {cc.Action}
- */
cc.Action.create = cc.action;
@@ -234,16 +178,13 @@ cc.Action.create = cc.action;
* - An action with a duration of 35.5 seconds.
*
* Infinite time actions are valid
- * @class
- * @extends cc.Action
+ * @class FiniteTimeAction
+ * @extends Action
*/
-cc.FiniteTimeAction = cc.Action.extend(/** @lends cc.FiniteTimeAction# */{
+cc.FiniteTimeAction = cc.Action.extend({
//! duration in seconds
_duration:0,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- */
ctor:function () {
cc.Action.prototype.ctor.call(this);
this._duration = 0;
@@ -251,7 +192,7 @@ cc.FiniteTimeAction = cc.Action.extend(/** @lends cc.FiniteTimeAction# */{
/**
* get duration of the action. (seconds)
- *
+ * @method getDuration
* @return {Number}
*/
getDuration:function () {
@@ -260,7 +201,7 @@ cc.FiniteTimeAction = cc.Action.extend(/** @lends cc.FiniteTimeAction# */{
/**
* set duration of the action. (seconds)
- *
+ * @method setDuration
* @param {Number} duration
*/
setDuration:function (duration) {
@@ -273,7 +214,7 @@ cc.FiniteTimeAction = cc.Action.extend(/** @lends cc.FiniteTimeAction# */{
* - 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
- *
+ * @method reverse
* @return {Null}
*/
reverse:function () {
@@ -284,8 +225,8 @@ cc.FiniteTimeAction = cc.Action.extend(/** @lends cc.FiniteTimeAction# */{
/**
* to copy object with deep copy.
* returns a clone of action.
- *
- * @return {cc.FiniteTimeAction}
+ * @method clone
+ * @return {FiniteTimeAction}
*/
clone:function () {
return new cc.FiniteTimeAction();
@@ -293,23 +234,27 @@ cc.FiniteTimeAction = cc.Action.extend(/** @lends cc.FiniteTimeAction# */{
});
/**
+ * @module actions
+ */
+
+/*
* 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.
*
* @warning This action can't be Sequenceable because it is not an cc.IntervalAction
* @class
- * @extends cc.Action
- * @param {cc.ActionInterval} action
+ * @extends Action
+ * @param {ActionInterval} action
* @param {Number} speed
*/
-cc.Speed = cc.Action.extend(/** @lends cc.Speed# */{
+cc.Speed = cc.Action.extend({
_speed:0.0,
_innerAction:null,
- /**
+ /*
* Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * @param {cc.ActionInterval} action
+ * @param {ActionInterval} action
* @param {Number} speed
*/
ctor:function (action, speed) {
@@ -320,7 +265,7 @@ cc.Speed = cc.Action.extend(/** @lends cc.Speed# */{
action && this.initWithAction(action, speed);
},
- /**
+ /*
* Gets the current running speed.
* Will get a percentage number, compared to the original speed.
*
@@ -330,7 +275,7 @@ cc.Speed = cc.Action.extend(/** @lends cc.Speed# */{
return this._speed;
},
- /**
+ /*
* alter the speed of the inner function in runtime.
*
* @param {Number} speed
@@ -339,10 +284,10 @@ cc.Speed = cc.Action.extend(/** @lends cc.Speed# */{
this._speed = speed;
},
- /**
+ /*
* initializes the action.
*
- * @param {cc.ActionInterval} action
+ * @param {ActionInterval} action
* @param {Number} speed
* @return {Boolean}
*/
@@ -355,71 +300,37 @@ cc.Speed = cc.Action.extend(/** @lends cc.Speed# */{
return true;
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.Speed}
- */
clone:function () {
var action = new cc.Speed();
action.initWithAction(this._innerAction.clone(), this._speed);
return action;
},
- /**
- * called before the action start. It will also set the target.
- *
- * @param {_ccsg.Node} target
- */
startWithTarget:function (target) {
cc.Action.prototype.startWithTarget.call(this, target);
this._innerAction.startWithTarget(target);
},
- /**
- * Stop the action.
- */
stop:function () {
this._innerAction.stop();
cc.Action.prototype.stop.call(this);
},
- /**
- * called every frame with it's delta time.
- * DON'T override unless you know what you are doing.
- *
- * @param {Number} dt
- */
step:function (dt) {
this._innerAction.step(dt * this._speed);
},
- /**
- * return true if the action has finished.
- *
- * @return {Boolean}
- */
isDone:function () {
return this._innerAction.isDone();
},
- /**
- * 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
- *
- * @return {cc.Speed}
- */
reverse:function () {
return new cc.Speed(this._innerAction.reverse(), this._speed);
},
- /**
+ /*
* Set inner Action.
- * @param {cc.ActionInterval} action
+ * @param {ActionInterval} action
*/
setInnerAction:function (action) {
if (this._innerAction !== action) {
@@ -427,10 +338,10 @@ cc.Speed = cc.Action.extend(/** @lends cc.Speed# */{
}
},
- /**
+ /*
* Get inner Action.
*
- * @return {cc.ActionInterval}
+ * @return {ActionInterval}
*/
getInnerAction:function () {
return this._innerAction;
@@ -438,31 +349,25 @@ cc.Speed = cc.Action.extend(/** @lends cc.Speed# */{
});
/**
- * creates the speed action.
+ * 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.
*
- * @function cc.speed
- * @param {cc.ActionInterval} action
+ * @warning This action can't be Sequenceable because it is not an cc.IntervalAction
+ *
+ * @method cc.speed
+ * @param {ActionInterval} action
* @param {Number} speed
- * @return {cc.Speed}
+ * @return {Speed}
*/
cc.speed = function (action, speed) {
return new cc.Speed(action, speed);
};
-/**
- * Please use cc.speed instead.
- * creates the action.
- *
- * @param {cc.ActionInterval} action
- * @param {Number} speed
- * @return {cc.Speed}
- * @static
- * @deprecated since v3.0 please use cc.speed() instead.
- */
cc.Speed.create = cc.speed;
-/**
- * cc.Follow is an action that "follows" a node.
+/*
+ * cc.Follow is a follow action which makes its target follows another node.
*
* @example
* //example
@@ -475,7 +380,7 @@ cc.Speed.create = cc.speed;
* @property {Number} bottomBoundary - world bottomBoundary.
*
* @param {_ccsg.Node} followedNode
- * @param {cc.Rect} rect
+ * @param {Rect} rect
* @example
* // creates the action with a set boundary
* var sprite = new _ccsg.Sprite("spriteFileName");
@@ -488,9 +393,9 @@ cc.Speed.create = cc.speed;
* this.runAction(followAction);
*
* @class
- * @extends cc.Action
+ * @extends Action
*/
-cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
+cc.Follow = cc.Action.extend({
// node to follow
_followedNode:null,
// whether camera should be limited to certain area
@@ -512,7 +417,7 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
* creates the action with a set boundary.
* creates the action with no boundary set.
* @param {_ccsg.Node} followedNode
- * @param {cc.Rect} rect
+ * @param {Rect} rect
*/
ctor:function (followedNode, rect) {
cc.Action.prototype.ctor.call(this);
@@ -534,12 +439,6 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
: this.initWithTarget(followedNode);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.Follow}
- */
clone:function () {
var action = new cc.Follow();
var locRect = this._worldRect;
@@ -548,7 +447,7 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
return action;
},
- /**
+ /*
* Get whether camera should be limited to certain area.
*
* @return {Boolean}
@@ -557,7 +456,7 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
return this._boundarySet;
},
- /**
+ /*
* alter behavior - turn on/off boundary.
*
* @param {Boolean} value
@@ -566,11 +465,11 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
this._boundarySet = value;
},
- /**
+ /*
* initializes the action with a set boundary.
*
* @param {_ccsg.Node} followedNode
- * @param {cc.Rect} [rect=]
+ * @param {Rect} [rect=]
* @return {Boolean}
*/
initWithTarget:function (followedNode, rect) {
@@ -613,12 +512,6 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
return true;
},
- /**
- * called every frame with it's delta time.
- * DON'T override unless you know what you are doing.
- *
- * @param {Number} dt
- */
step:function (dt) {
var tempPosX = this._followedNode.x;
var tempPosY = this._followedNode.y;
@@ -639,18 +532,10 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
}
},
- /**
- * Return true if the action has finished.
- *
- * @return {Boolean}
- */
isDone:function () {
return ( !this._followedNode.running );
},
- /**
- * Stop the action.
- */
stop:function () {
this.target = null;
cc.Action.prototype.stop.call(this);
@@ -658,37 +543,24 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
});
/**
- * creates the action with a set boundary.
- * creates the action with no boundary set.
+ * Create a follow action which makes its target follows another node.
*
- * @function
- * @param {_ccsg.Node} followedNode
- * @param {cc.Rect} rect
- * @return {cc.Follow|Null} returns the cc.Follow object on success
+ * @method
+ * @param {Node} followedNode
+ * @param {Rect} rect
+ * @return {Follow|Null} returns the cc.Follow object on success
* @example
* // example
* // creates the action with a set boundary
- * var sprite = new _ccsg.Sprite("spriteFileName");
- * var followAction = cc.follow(sprite, cc.rect(0, 0, s.width * 2 - 100, s.height));
- * this.runAction(followAction);
+ * var followAction = cc.follow(targetNode, cc.rect(0, 0, screenWidth * 2 - 100, screenHeight));
+ * node.runAction(followAction);
*
* // creates the action with no boundary set
- * var sprite = new _ccsg.Sprite("spriteFileName");
- * var followAction = cc.follow(sprite);
- * this.runAction(followAction);
+ * var followAction = cc.follow(targetNode);
+ * node.runAction(followAction);
*/
cc.follow = function (followedNode, rect) {
return new cc.Follow(followedNode, rect);
};
-/**
- * Please use cc.follow instead.
- * creates the action with a set boundary.
- * creates the action with no boundary set.
- * @param {_ccsg.Node} followedNode
- * @param {cc.Rect} rect
- * @return {cc.Follow|Null} returns the cc.Follow object on success
- * @static
- * @deprecated since v3.0 please cc.follow() instead.
- */
cc.Follow.create = cc.follow;
diff --git a/cocos2d/actions/CCActionCamera.js b/cocos2d/actions/CCActionCamera.js
index cc1c0186aa..a346d0733e 100644
--- a/cocos2d/actions/CCActionCamera.js
+++ b/cocos2d/actions/CCActionCamera.js
@@ -27,9 +27,9 @@
/**
* Base class for cc.Camera actions
* @class
- * @extends cc.ActionInterval
+ * @extends ActionInterval
*/
-cc.ActionCamera = cc.ActionInterval.extend(/** @lends cc.ActionCamera# */{
+cc.ActionCamera = cc.ActionInterval.extend({
_centerXOrig:0,
_centerYOrig:0,
_centerZOrig:0,
@@ -88,7 +88,7 @@ cc.ActionCamera = cc.ActionInterval.extend(/** @lends cc.ActionCamera# */{
* to copy object with deep copy.
* returns a new clone of the action
*
- * @returns {cc.ActionCamera}
+ * @returns {ActionCamera}
*/
clone:function(){
return new cc.ActionCamera();
@@ -119,9 +119,9 @@ cc.ActionCamera = cc.ActionInterval.extend(/** @lends cc.ActionCamera# */{
* @param {Number} deltaAngleX
*
* @class
- * @extends cc.ActionCamera
+ * @extends ActionCamera
*/
-cc.OrbitCamera = cc.ActionCamera.extend(/** @lends cc.OrbitCamera# */{
+cc.OrbitCamera = cc.ActionCamera.extend({
_radius: 0.0,
_deltaRadius: 0.0,
_angleZ: 0.0,
@@ -232,7 +232,7 @@ cc.OrbitCamera = cc.ActionCamera.extend(/** @lends cc.OrbitCamera# */{
* to copy object with deep copy.
* returns a new clone of the action
*
- * @returns {cc.ActionCamera}
+ * @returns {ActionCamera}
*/
clone:function(){
var a = new cc.OrbitCamera(), _t = this;
@@ -262,7 +262,7 @@ cc.OrbitCamera = cc.ActionCamera.extend(/** @lends cc.OrbitCamera# */{
/**
* creates a cc.OrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX
- * @function
+ * @method
* @param {Number} t time
* @param {Number} radius
* @param {Number} deltaRadius
@@ -270,7 +270,7 @@ cc.OrbitCamera = cc.ActionCamera.extend(/** @lends cc.OrbitCamera# */{
* @param {Number} deltaAngleZ
* @param {Number} angleX
* @param {Number} deltaAngleX
- * @return {cc.OrbitCamera}
+ * @return {OrbitCamera}
*/
cc.orbitCamera = function (t, radius, deltaRadius, angleZ, deltaAngleZ, angleX, deltaAngleX) {
return new cc.OrbitCamera(t, radius, deltaRadius, angleZ, deltaAngleZ, angleX, deltaAngleX);
@@ -286,7 +286,7 @@ cc.orbitCamera = function (t, radius, deltaRadius, angleZ, deltaAngleZ, angleX,
* @param {Number} deltaAngleZ
* @param {Number} angleX
* @param {Number} deltaAngleX
- * @return {cc.OrbitCamera}
+ * @return {OrbitCamera}
* @static
* @deprecated since v3.0 please use cc.orbitCamera() instead.
*/
diff --git a/cocos2d/actions/CCActionCatmullRom.js b/cocos2d/actions/CCActionCatmullRom.js
index 6beb30a18b..c540d4d4be 100644
--- a/cocos2d/actions/CCActionCatmullRom.js
+++ b/cocos2d/actions/CCActionCatmullRom.js
@@ -33,18 +33,21 @@
****************************************************************************/
/**
+ * @module actions
+ */
+
+/*
* Returns the Cardinal Spline position for a given set of control points, tension and time.
* CatmullRom Spline formula.
* s(-ttt + 2tt - t)P1 + s(-ttt + tt)P2 + (2ttt - 3tt + 1)P2 + s(ttt - 2tt + t)P3 + (-2ttt + 3tt)P3 + s(ttt - tt)P4
*
- * @function
- * @param {cc.Vec2} p0
- * @param {cc.Vec2} p1
- * @param {cc.Vec2} p2
- * @param {cc.Vec2} p3
+ * @param {Vec2} p0
+ * @param {Vec2} p1
+ * @param {Vec2} p2
+ * @param {Vec2} p3
* @param {Number} tension
* @param {Number} t
- * @return {cc.Vec2}
+ * @return {Vec2}
*/
cc.cardinalSplineAt = function (p0, p1, p2, p3, tension, t) {
var t2 = t * t;
@@ -65,7 +68,7 @@ cc.cardinalSplineAt = function (p0, p1, p2, p3, tension, t) {
return cc.p(x, y);
};
-/**
+/*
* returns a new copy of the array reversed.
*
* @return {Array}
@@ -79,7 +82,7 @@ cc.reverseControlPoints = function (controlPoints) {
};
-/**
+/*
* returns a new clone of the controlPoints
*
* @param controlPoints
@@ -92,15 +95,9 @@ cc.cloneControlPoints = function (controlPoints) {
return newArray;
};
-/**
- * returns a new clone of the controlPoints
- * @deprecated since v3.0 please use cc.cloneControlPoints() instead.
- * @param controlPoints
- * @returns {Array}
- */
cc.copyControlPoints = cc.cloneControlPoints;
-/**
+/*
* returns a point from the array
*
* @param {Array} controlPoints
@@ -112,7 +109,7 @@ cc.getControlPointAt = function (controlPoints, pos) {
return controlPoints[p];
};
-/**
+/*
* reverse the current control point array inline, without generating a new one
*
* @param controlPoints
@@ -128,12 +125,12 @@ cc.reverseControlPointsInline = function (controlPoints) {
};
-/**
- * Cardinal Spline path. {@link http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline}
+/*
+ * Cardinal Spline path. http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline
* Absolute coordinates.
*
- * @class
- * @extends cc.ActionInterval
+ * @class CardinalSplineTo
+ * @extends ActionInterval
* @param {Number} duration
* @param {Array} points array of control points
* @param {Number} tension
@@ -142,21 +139,14 @@ cc.reverseControlPointsInline = function (controlPoints) {
* //create a cc.CardinalSplineTo
* var action1 = cc.cardinalSplineTo(3, array, 0);
*/
-cc.CardinalSplineTo = cc.ActionInterval.extend(/** @lends cc.CardinalSplineTo# */{
- /** Array of control points */
+cc.CardinalSplineTo = cc.ActionInterval.extend({
+ /* Array of control points */
_points:null,
_deltaT:0,
_tension:0,
_previousPosition:null,
_accumulatedDiff:null,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * Creates an action with a Cardinal Spline array of points and tension.
- * @param {Number} duration
- * @param {Array} points array of control points
- * @param {Number} tension
- */
ctor: function (duration, points, tension) {
cc.ActionInterval.prototype.ctor.call(this);
@@ -164,7 +154,7 @@ cc.CardinalSplineTo = cc.ActionInterval.extend(/** @lends cc.CardinalSplineTo# *
tension !== undefined && this.initWithDuration(duration, points, tension);
},
- /**
+ /*
* initializes the action with a duration and an array of points
*
* @param {Number} duration
@@ -185,22 +175,12 @@ cc.CardinalSplineTo = cc.ActionInterval.extend(/** @lends cc.CardinalSplineTo# *
return false;
},
- /**
- * returns a new clone of the action
- *
- * @returns {cc.CardinalSplineTo}
- */
clone:function () {
var action = new cc.CardinalSplineTo();
action.initWithDuration(this._duration, cc.copyControlPoints(this._points), this._tension);
return action;
},
- /**
- * called before the action start. It will also set the target.
- *
- * @param {_ccsg.Node} target
- */
startWithTarget:function (target) {
cc.ActionInterval.prototype.startWithTarget.call(this, target);
// Issue #1441 from cocos2d-iphone
@@ -209,11 +189,6 @@ cc.CardinalSplineTo = cc.ActionInterval.extend(/** @lends cc.CardinalSplineTo# *
this._accumulatedDiff = cc.p(0, 0);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
dt = this._computeEaseTime(dt);
var p, lt;
@@ -255,28 +230,22 @@ cc.CardinalSplineTo = cc.ActionInterval.extend(/** @lends cc.CardinalSplineTo# *
this.updatePosition(newPos);
},
- /**
- * reverse a new cc.CardinalSplineTo.
- * Along the track of movement in the opposite.
- *
- * @return {cc.CardinalSplineTo}
- */
reverse:function () {
var reversePoints = cc.reverseControlPoints(this._points);
return cc.cardinalSplineTo(this._duration, reversePoints, this._tension);
},
- /**
+ /*
* update position of target
*
- * @param {cc.Vec2} newPos
+ * @param {Vec2} newPos
*/
updatePosition:function (newPos) {
this.target.setPosition(newPos);
this._previousPosition = newPos;
},
- /**
+ /*
* Points getter
*
* @return {Array}
@@ -285,7 +254,7 @@ cc.CardinalSplineTo = cc.ActionInterval.extend(/** @lends cc.CardinalSplineTo# *
return this._points;
},
- /**
+ /*
* Points setter
*
* @param {Array} points
@@ -298,11 +267,11 @@ cc.CardinalSplineTo = cc.ActionInterval.extend(/** @lends cc.CardinalSplineTo# *
/**
* creates an action with a Cardinal Spline array of points and tension.
*
- * @function
+ * @method cc.cardinalSplineTo
* @param {Number} duration
* @param {Array} points array of control points
* @param {Number} tension
- * @return {cc.CardinalSplineTo}
+ * @return {CardinalSplineTo}
*
* @example
* //create a cc.CardinalSplineTo
@@ -312,26 +281,14 @@ cc.cardinalSplineTo = function (duration, points, tension) {
return new cc.CardinalSplineTo(duration, points, tension);
};
-/**
- * Please use cc.cardinalSplineTo instead.
- * creates an action with a Cardinal Spline array of points and tension
- *
- * @function
- * @param {Number} duration
- * @param {Array} points array of control points
- * @param {Number} tension
- * @return {cc.CardinalSplineTo}
- * @static
- * @deprecated since v3.0 please use cc.cardinalSplineTo(duration, points, tension) instead.
- */
cc.CardinalSplineTo.create = cc.cardinalSplineTo;
-/**
- * Cardinal Spline path. {@link http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline}
+/*
+ * Cardinal Spline path. http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline
* Relative coordinates.
*
- * @class
- * @extends cc.CardinalSplineTo
+ * @class CardinalSplineBy
+ * @extends CardinalSplineTo
* @param {Number} duration
* @param {Array} points
* @param {Number} tension
@@ -340,16 +297,9 @@ cc.CardinalSplineTo.create = cc.cardinalSplineTo;
* //create a cc.CardinalSplineBy
* var action1 = cc.cardinalSplineBy(3, array, 0);
*/
-cc.CardinalSplineBy = cc.CardinalSplineTo.extend(/** @lends cc.CardinalSplineBy# */{
+cc.CardinalSplineBy = cc.CardinalSplineTo.extend({
_startPosition:null,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * creates an action with a Cardinal Spline array of points and tension.
- * @param {Number} duration
- * @param {Array} points
- * @param {Number} tension
- */
ctor:function (duration, points, tension) {
cc.CardinalSplineTo.prototype.ctor.call(this);
this._startPosition = cc.p(0, 0);
@@ -357,22 +307,12 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend(/** @lends cc.CardinalSplineBy#
tension !== undefined && this.initWithDuration(duration, points, tension);
},
- /**
- * called before the action start. It will also set the target.
- *
- * @param {_ccsg.Node} target
- */
startWithTarget:function (target) {
cc.CardinalSplineTo.prototype.startWithTarget.call(this, target);
this._startPosition.x = target.getPositionX();
this._startPosition.y = target.getPositionY();
},
- /**
- * reverse a new cc.CardinalSplineBy
- *
- * @return {cc.CardinalSplineBy}
- */
reverse:function () {
var copyConfig = this._points.slice();
var current;
@@ -409,10 +349,10 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend(/** @lends cc.CardinalSplineBy#
return cc.cardinalSplineBy(this._duration, reverseArray, this._tension);
},
- /**
+ /*
* update position of target
*
- * @param {cc.Vec2} newPos
+ * @param {Vec2} newPos
*/
updatePosition:function (newPos) {
var pos = this._startPosition;
@@ -423,10 +363,10 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend(/** @lends cc.CardinalSplineBy#
this.target.setPosition(posX, posY);
},
- /**
+ /*
* returns a new clone of the action
*
- * @returns {cc.CardinalSplineBy}
+ * @returns {CardinalSplineBy}
*/
clone:function () {
var a = new cc.CardinalSplineBy();
@@ -438,57 +378,39 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend(/** @lends cc.CardinalSplineBy#
/**
* creates an action with a Cardinal Spline array of points and tension.
*
- * @function
+ * @method cc.cardinalSplineBy
* @param {Number} duration
* @param {Array} points
* @param {Number} tension
*
- * @return {cc.CardinalSplineBy}
+ * @return {CardinalSplineBy}
*/
cc.cardinalSplineBy = function (duration, points, tension) {
return new cc.CardinalSplineBy(duration, points, tension);
};
-
-/**
- * Please use cc.cardinalSplineBy instead.
- * creates an action with a Cardinal Spline array of points and tension.
- * @function
- * @param {Number} duration
- * @param {Array} points
- * @param {Number} tension
- * @return {cc.CardinalSplineBy}
- * @static
- * @deprecated since v3.0 please use cc.cardinalSplineBy(duration, points, tension);
- */
cc.CardinalSplineBy.create = cc.cardinalSplineBy;
-/**
+/*
* An action that moves the target with a CatmullRom curve to a destination point.
* A Catmull Rom is a Cardinal Spline with a tension of 0.5.
- * {@link http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline}
+ * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline
* Absolute coordinates.
*
- * @class
- * @extends cc.CardinalSplineTo
+ * @class CatmullRomTo
+ * @extends CardinalSplineTo
* @param {Number} dt
* @param {Array} points
*
* @example
* var action1 = cc.catmullRomTo(3, array);
*/
-cc.CatmullRomTo = cc.CardinalSplineTo.extend(/** @lends cc.CatmullRomTo# */{
+cc.CatmullRomTo = cc.CardinalSplineTo.extend({
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * creates an action with a Cardinal Spline array of points and tension.
- * @param {Number} dt
- * @param {Array} points
- */
ctor: function(dt, points) {
points && this.initWithDuration(dt, points);
},
- /**
+ /*
* Initializes the action with a duration and an array of points
*
* @param {Number} dt
@@ -498,10 +420,6 @@ cc.CatmullRomTo = cc.CardinalSplineTo.extend(/** @lends cc.CatmullRomTo# */{
return cc.CardinalSplineTo.prototype.initWithDuration.call(this, dt, points, 0.5);
},
- /**
- * returns a new clone of the action
- * @returns {cc.CatmullRomTo}
- */
clone:function () {
var action = new cc.CatmullRomTo();
action.initWithDuration(this._duration, cc.copyControlPoints(this._points));
@@ -512,10 +430,10 @@ cc.CatmullRomTo = cc.CardinalSplineTo.extend(/** @lends cc.CatmullRomTo# */{
/**
* creates an action with a Cardinal Spline array of points and tension.
*
- * @function
+ * @method cc.catmullRomTo
* @param {Number} dt
* @param {Array} points
- * @return {cc.CatmullRomTo}
+ * @return {CatmullRomTo}
*
* @example
* var action1 = cc.catmullRomTo(3, array);
@@ -523,26 +441,16 @@ cc.CatmullRomTo = cc.CardinalSplineTo.extend(/** @lends cc.CatmullRomTo# */{
cc.catmullRomTo = function (dt, points) {
return new cc.CatmullRomTo(dt, points);
};
-/**
- * Please use cc.catmullRomTo instead.
- * creates an action with a Cardinal Spline array of points and tension.
- *
- * @param {Number} dt
- * @param {Array} points
- * @return {cc.CatmullRomTo}
- * @static
- * @deprecated since v3.0 please use cc.catmullRomTo(dt, points) instead.
- */
cc.CatmullRomTo.create = cc.catmullRomTo;
-/**
+/*
* An action that moves the target with a CatmullRom curve by a certain distance.
* A Catmull Rom is a Cardinal Spline with a tension of 0.5.
* http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline
* Relative coordinates.
*
- * @class
- * @extends cc.CardinalSplineBy
+ * @class CatmullRomBy
+ * @extends CardinalSplineBy
* @param {Number} dt
* @param {Array} points
*
@@ -551,21 +459,15 @@ cc.CatmullRomTo.create = cc.catmullRomTo;
*/
cc.CatmullRomBy = cc.CardinalSplineBy.extend({
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * Creates an action with a Cardinal Spline array of points and tension.
- * @param {Number} dt
- * @param {Array} points
- */
ctor: function(dt, points) {
cc.CardinalSplineBy.prototype.ctor.call(this);
points && this.initWithDuration(dt, points);
},
- /**
+ /*
* initializes the action with a duration and an array of points
*
- * @function
+ * @method
* @param {Number} dt
* @param {Array} points
*/
@@ -573,10 +475,6 @@ cc.CatmullRomBy = cc.CardinalSplineBy.extend({
return cc.CardinalSplineTo.prototype.initWithDuration.call(this, dt, points, 0.5);
},
- /**
- * returns a new clone of the action
- * @returns {cc.CatmullRomBy}
- */
clone:function () {
var action = new cc.CatmullRomBy();
action.initWithDuration(this._duration, cc.copyControlPoints(this._points));
@@ -586,20 +484,14 @@ cc.CatmullRomBy = cc.CardinalSplineBy.extend({
/**
* Creates an action with a Cardinal Spline array of points and tension
- * @function
+ * @method cc.catmullRomBy
* @param {Number} dt
* @param {Array} points
- * @return {cc.CatmullRomBy}
+ * @return {CatmullRomBy}
* @example
* var action1 = cc.catmullRomBy(3, array);
*/
cc.catmullRomBy = function (dt, points) {
return new cc.CatmullRomBy(dt, points);
};
-/**
- * Please use cc.catmullRomBy instead
- * Creates an action with a Cardinal Spline array of points and tension
- * @static
- * @deprecated since v3.0 please cc.catmullRomBy(dt, points) instead.
- */
cc.CatmullRomBy.create = cc.catmullRomBy;
diff --git a/cocos2d/actions/CCActionEase.js b/cocos2d/actions/CCActionEase.js
index e5f27d8017..cd198af3aa 100644
--- a/cocos2d/actions/CCActionEase.js
+++ b/cocos2d/actions/CCActionEase.js
@@ -25,24 +25,18 @@
****************************************************************************/
/**
- * Base class for Easing actions
- * @class
- * @extends cc.ActionInterval
- * @param {cc.ActionInterval} action
- *
- * @deprecated since v3.0 Does not recommend the use of the base object.
- *
- * @example
- * var moveEase = new cc.ActionEase(action);
+ * @module actions
*/
-cc.ActionEase = cc.ActionInterval.extend(/** @lends cc.ActionEase# */{
+
+/**
+ * Base class for Easing actions
+ * @class ActionEase
+ * @extends ActionInterval
+ * @param {ActionInterval} action
+ */
+cc.ActionEase = cc.ActionInterval.extend({
_inner:null,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * creates the action of ActionEase.
- * @param {cc.ActionInterval} action
- */
ctor: function (action) {
cc.ActionInterval.prototype.ctor.call(this);
action && this.initWithAction(action);
@@ -51,7 +45,7 @@ cc.ActionEase = cc.ActionInterval.extend(/** @lends cc.ActionEase# */{
/**
* initializes the action
*
- * @param {cc.ActionInterval} action
+ * @param {ActionInterval} action
* @return {Boolean}
*/
initWithAction:function (action) {
@@ -65,53 +59,26 @@ cc.ActionEase = cc.ActionInterval.extend(/** @lends cc.ActionEase# */{
return false;
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.ActionEase}
- */
clone:function(){
var action = new cc.ActionEase();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * called before the action start. It will also set the target.
- *
- * @param {_ccsg.Node} target
- */
startWithTarget:function (target) {
cc.ActionInterval.prototype.startWithTarget.call(this, target);
this._inner.startWithTarget(this.target);
},
- /**
- * Stop the action.
- */
stop:function () {
this._inner.stop();
cc.ActionInterval.prototype.stop.call(this);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
this._inner.update(dt);
},
- /**
- * Create new action to original operation effect opposite.
- * 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
- * @return {cc.ActionEase}
- */
reverse:function () {
return new cc.ActionEase(this._inner.reverse());
},
@@ -119,62 +86,30 @@ cc.ActionEase = cc.ActionInterval.extend(/** @lends cc.ActionEase# */{
/**
* Get inner Action.
*
- * @return {cc.ActionInterval}
+ * @return {ActionInterval}
*/
getInnerAction:function(){
return this._inner;
}
});
-/**
- * creates the action of ActionEase
- *
- * @param {cc.ActionInterval} action
- * @return {cc.ActionEase}
- * @example
- * // example
- * var moveEase = cc.actionEase(action);
- */
cc.actionEase = function (action) {
return new cc.ActionEase(action);
};
-/**
- * Please use cc.actionEase instead
- * creates the action of ActionEase
- *
- * @param {cc.ActionInterval} action
- * @return {cc.ActionEase}
- * @static
- * @deprecated since v3.0 please use cc.actionEase(action) instead.
- */
cc.ActionEase.create = cc.actionEase;
/**
* Base class for Easing actions with rate parameters
*
- * @class
- * @extends cc.ActionEase
- * @param {cc.ActionInterval} action
+ * @class EaseRateAction
+ * @extends ActionEase
+ * @param {ActionInterval} action
* @param {Number} rate
- *
- * @deprecated since v3.0 please cc.easeRateAction(action, 3.0);
- *
- * @example
- * //The old usage
- * cc.EaseRateAction.create(action, 3.0);
- * //The new usage
- * var moveEaseRateAction = cc.easeRateAction(action, 3.0);
*/
-cc.EaseRateAction = cc.ActionEase.extend(/** @lends cc.EaseRateAction# */{
+cc.EaseRateAction = cc.ActionEase.extend({
_rate:0,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * Creates the action with the inner action and the rate parameter.
- * @param {cc.ActionInterval} action
- * @param {Number} rate
- */
ctor: function(action, rate){
cc.ActionEase.prototype.ctor.call(this);
@@ -198,7 +133,7 @@ cc.EaseRateAction = cc.ActionEase.extend(/** @lends cc.EaseRateAction# */{
/**
* Initializes the action with the inner action and the rate parameter
- * @param {cc.ActionInterval} action
+ * @param {ActionInterval} action
* @param {Number} rate
* @return {Boolean}
*/
@@ -210,67 +145,32 @@ cc.EaseRateAction = cc.ActionEase.extend(/** @lends cc.EaseRateAction# */{
return false;
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseRateAction}
- */
clone:function(){
var action = new cc.EaseRateAction();
action.initWithAction(this._inner.clone(), this._rate);
return action;
},
- /**
- * Create new action to original operation effect opposite.
- * 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
- * @return {cc.EaseRateAction}
- */
reverse:function () {
return new cc.EaseRateAction(this._inner.reverse(), 1 / this._rate);
}
});
-/**
- * Creates the action with the inner action and the rate parameter.
- *
- * @param {cc.ActionInterval} action
- * @param {Number} rate
- * @return {cc.EaseRateAction}
- * @example
- * // example
- * var moveEaseRateAction = cc.easeRateAction(action, 3.0);
- */
cc.easeRateAction = function (action, rate) {
return new cc.EaseRateAction(action, rate);
};
-/**
- * Please use cc.easeRateAction instead.
- * Creates the action with the inner action and the rate parameter.
- *
- * @param {cc.ActionInterval} action
- * @param {Number} rate
- * @return {cc.EaseRateAction}
- * @static
- * @deprecated since v3.0 please use cc.easeRateAction(action, rate)
- * @example
- * //The old usage
- * cc.EaseRateAction.create(action, 3.0);
- * //The new usage
- * var moveEaseRateAction = cc.easeRateAction(action, 3.0);
- */
cc.EaseRateAction.create = cc.easeRateAction;
/**
+ * @module actions
+ */
+
+/*
* cc.EaseIn action with a rate. From slow to fast.
*
- * @class
- * @extends cc.EaseRateAction
+ * @class EaseIn
+ * @extends EaseRateAction
*
* @deprecated since v3.0 please use action.easing(cc.easeIn(3));
*
@@ -280,31 +180,16 @@ cc.EaseRateAction.create = cc.easeRateAction;
* //The new usage
* action.easing(cc.easeIn(3.0));
*/
-cc.EaseIn = cc.EaseRateAction.extend(/** @lends cc.EaseIn# */{
+cc.EaseIn = cc.EaseRateAction.extend({
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
this._inner.update(Math.pow(dt, this._rate));
},
- /**
- * Create a cc.easeIn action. Opposite with the original motion trajectory.
- * @return {cc.EaseIn}
- */
reverse:function () {
return new cc.EaseIn(this._inner.reverse(), 1 / this._rate);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseIn}
- */
clone:function(){
var action = new cc.EaseIn();
action.initWithAction(this._inner.clone(), this._rate);
@@ -312,23 +197,6 @@ cc.EaseIn = cc.EaseRateAction.extend(/** @lends cc.EaseIn# */{
}
});
-/**
- * Creates the action with the inner action and the rate parameter.
- * From slow to fast.
- *
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeIn(3))
- *
- * @example
- * //The old usage
- * cc.EaseIn.create(action, 3);
- * //The new usage
- * action.easing(cc.easeIn(3.0));
- *
- * @param {cc.ActionInterval} action
- * @param {Number} rate
- * @return {cc.EaseIn}
- */
cc.EaseIn.create = function (action, rate) {
return new cc.EaseIn(action, rate);
};
@@ -337,7 +205,7 @@ cc.EaseIn.create = function (action, rate) {
* Creates the action easing object with the rate parameter.
* From slow to fast.
*
- * @function
+ * @method cc.easeIn
* @param {Number} rate
* @return {Object}
* @example
@@ -356,11 +224,11 @@ cc.easeIn = function (rate) {
};
};
-/**
+/*
* cc.EaseOut action with a rate. From fast to slow.
*
- * @class
- * @extends cc.EaseRateAction
+ * @class EaseOut
+ * @extends EaseRateAction
*
* @deprecated since v3.0 please use action.easing(cc.easeOut(3))
*
@@ -370,30 +238,15 @@ cc.easeIn = function (rate) {
* //The new usage
* action.easing(cc.easeOut(3.0));
*/
-cc.EaseOut = cc.EaseRateAction.extend(/** @lends cc.EaseOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseOut = cc.EaseRateAction.extend({
update:function (dt) {
this._inner.update(Math.pow(dt, 1 / this._rate));
},
- /**
- * Create a cc.easeIn action. Opposite with the original motion trajectory.
- * @return {cc.EaseOut}
- */
reverse:function () {
return new cc.EaseOut(this._inner.reverse(), 1 / this._rate);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseOut}
- */
clone:function(){
var action = new cc.EaseOut();
action.initWithAction(this._inner.clone(),this._rate);
@@ -401,23 +254,6 @@ cc.EaseOut = cc.EaseRateAction.extend(/** @lends cc.EaseOut# */{
}
});
-/**
- * Creates the action with the inner action and the rate parameter.
- * From fast to slow.
- *
- * @static
- * @deprecated since v3.0
Please use cc.easeOut instead.
- *
- * @example
- * //The old usage
- * cc.EaseOut.create(action, 3);
- * //The new usage
- * action.easing(cc.easeOut(3.0));
- *
- * @param {cc.ActionInterval} action
- * @param {Number} rate
- * @return {cc.EaseOut}
- */
cc.EaseOut.create = function (action, rate) {
return new cc.EaseOut(action, rate);
};
@@ -426,7 +262,7 @@ cc.EaseOut.create = function (action, rate) {
* Creates the action easing object with the rate parameter.
* From fast to slow.
*
- * @function
+ * @method cc.easeOut
* @param {Number} rate
* @return {Object}
* @example
@@ -440,16 +276,16 @@ cc.easeOut = function (rate) {
return Math.pow(dt, 1 / this._rate);
},
reverse: function(){
- return cc.easeOut(1 / this._rate)
+ return cc.easeOut(1 / this._rate);
}
};
};
-/**
+/*
* cc.EaseInOut action with a rate.
* Slow to fast then to slow.
- * @class
- * @extends cc.EaseRateAction
+ * @class EaseInOut
+ * @extends EaseRateAction
*
* @deprecated since v3.0 please use action.easing(cc.easeInOut(3.0))
*
@@ -459,12 +295,7 @@ cc.easeOut = function (rate) {
* //The new usage
* action.easing(cc.easeInOut(3.0));
*/
-cc.EaseInOut = cc.EaseRateAction.extend(/** @lends cc.EaseInOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseInOut = cc.EaseRateAction.extend({
update:function (dt) {
dt *= 2;
if (dt < 1)
@@ -473,43 +304,17 @@ cc.EaseInOut = cc.EaseRateAction.extend(/** @lends cc.EaseInOut# */{
this._inner.update(1.0 - 0.5 * Math.pow(2 - dt, this._rate));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseInOut}
- */
clone:function(){
var action = new cc.EaseInOut();
action.initWithAction(this._inner.clone(), this._rate);
return action;
},
- /**
- * Create a cc.EaseInOut action. Opposite with the original motion trajectory.
- * @return {cc.EaseInOut}
- */
reverse:function () {
return new cc.EaseInOut(this._inner.reverse(), this._rate);
}
});
-/**
- * Creates the action with the inner action and the rate parameter.
- * Slow to fast then to slow.
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeInOut(3.0))
- *
- * @example
- * //The old usage
- * cc.EaseInOut.create(action, 3);
- * //The new usage
- * action.easing(cc.easeInOut(3.0));
- *
- * @param {cc.ActionInterval} action
- * @param {Number} rate
- * @return {cc.EaseInOut}
- */
cc.EaseInOut.create = function (action, rate) {
return new cc.EaseInOut(action, rate);
};
@@ -517,7 +322,7 @@ cc.EaseInOut.create = function (action, rate) {
/**
* Creates the action easing object with the rate parameter.
* Slow to fast then to slow.
- * @function
+ * @method cc.easeInOut
* @param {Number} rate
* @return {Object}
*
@@ -541,12 +346,12 @@ cc.easeInOut = function (rate) {
};
};
-/**
+/*
* cc.Ease Exponential In. Slow to Fast.
* Reference easeInExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseExponentialIn
+ * @extends ActionEase
*
* @deprecated since v3.0 please action.easing(cc.easeExponentialIn())
*
@@ -556,30 +361,15 @@ cc.easeInOut = function (rate) {
* //The new usage
* action.easing(cc.easeExponentialIn());
*/
-cc.EaseExponentialIn = cc.ActionEase.extend(/** @lends cc.EaseExponentialIn# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseExponentialIn = cc.ActionEase.extend({
update:function (dt) {
this._inner.update(dt === 0 ? 0 : Math.pow(2, 10 * (dt - 1)));
},
- /**
- * Create a cc.EaseExponentialOut action. Opposite with the original motion trajectory.
- * @return {cc.EaseExponentialOut}
- */
reverse:function () {
return new cc.EaseExponentialOut(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseExponentialIn}
- */
clone:function(){
var action = new cc.EaseExponentialIn();
action.initWithAction(this._inner.clone());
@@ -587,21 +377,6 @@ cc.EaseExponentialIn = cc.ActionEase.extend(/** @lends cc.EaseExponentialIn# */{
}
});
-/**
- * Creates the action easing object with the rate parameter.
- * Reference easeInExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeExponentialIn())
- * @param {cc.ActionInterval} action
- * @return {cc.EaseExponentialIn}
- *
- * @example
- * //The old usage
- * cc.EaseExponentialIn.create(action);
- * //The new usage
- * action.easing(cc.easeExponentialIn());
- */
cc.EaseExponentialIn.create = function (action) {
return new cc.EaseExponentialIn(action);
};
@@ -618,8 +393,8 @@ cc._easeExponentialInObj = {
/**
* Creates the action easing object with the rate parameter.
* Reference easeInExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeExponentialIn
* @return {Object}
* @example
* // example
@@ -629,12 +404,12 @@ cc.easeExponentialIn = function(){
return cc._easeExponentialInObj;
};
-/**
+/*
* Ease Exponential Out.
* Reference easeOutExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseExponentialOut
+ * @extends ActionEase
*
* @deprecated since v3.0 please use action.easing(cc.easeExponentialOut())
*
@@ -644,30 +419,15 @@ cc.easeExponentialIn = function(){
* //The new usage
* action.easing(cc.easeExponentialOut());
*/
-cc.EaseExponentialOut = cc.ActionEase.extend(/** @lends cc.EaseExponentialOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseExponentialOut = cc.ActionEase.extend({
update:function (dt) {
this._inner.update(dt === 1 ? 1 : (-(Math.pow(2, -10 * dt)) + 1));
},
- /**
- * Create a cc.EaseExponentialIn action. Opposite with the original motion trajectory.
- * @return {cc.EaseExponentialIn}
- */
reverse:function () {
return new cc.EaseExponentialIn(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseExponentialOut}
- */
clone:function(){
var action = new cc.EaseExponentialOut();
action.initWithAction(this._inner.clone());
@@ -675,21 +435,6 @@ cc.EaseExponentialOut = cc.ActionEase.extend(/** @lends cc.EaseExponentialOut# *
}
});
-/**
- * Creates the action easing object with the rate parameter.
- * Reference easeOutExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeExponentialOut())
- * @param {cc.ActionInterval} action
- * @return {Object}
- *
- * @example
- * //The old usage
- * cc.EaseExponentialOut.create(action);
- * //The new usage
- * action.easing(cc.easeExponentialOut());
- */
cc.EaseExponentialOut.create = function (action) {
return new cc.EaseExponentialOut(action);
};
@@ -706,8 +451,8 @@ cc._easeExponentialOutObj = {
/**
* creates the action easing object.
* Reference easeOutExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- *
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeExponentialOut
* @return {Object}
* @example
* // example
@@ -717,13 +462,13 @@ cc.easeExponentialOut = function(){
return cc._easeExponentialOutObj;
};
-/**
+/*
* Ease Exponential InOut.
* Reference easeInOutExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
+ * http://www.zhihu.com/question/21981571/answer/19925418
*
- * @class
- * @extends cc.ActionEase
+ * @class EaseExponentialInOut
+ * @extends ActionEase
*
* @deprecated since v3.0 please use action.easing(cc.easeExponentialInOut)
*
@@ -733,12 +478,7 @@ cc.easeExponentialOut = function(){
* //The new usage
* action.easing(cc.easeExponentialInOut());
*/
-cc.EaseExponentialInOut = cc.ActionEase.extend(/** @lends cc.EaseExponentialInOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseExponentialInOut = cc.ActionEase.extend({
update:function (dt) {
if( dt !== 1 && dt !== 0) {
dt *= 2;
@@ -750,20 +490,10 @@ cc.EaseExponentialInOut = cc.ActionEase.extend(/** @lends cc.EaseExponentialInOu
this._inner.update(dt);
},
- /**
- * Create a cc.EaseExponentialInOut action. Opposite with the original motion trajectory.
- * @return {cc.EaseExponentialInOut}
- */
reverse:function () {
return new cc.EaseExponentialInOut(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseExponentialInOut}
- */
clone:function(){
var action = new cc.EaseExponentialInOut();
action.initWithAction(this._inner.clone());
@@ -771,21 +501,6 @@ cc.EaseExponentialInOut = cc.ActionEase.extend(/** @lends cc.EaseExponentialInOu
}
});
-/**
- * creates an EaseExponentialInOut action.
- * Reference easeInOutExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeExponentialInOut)
- * @param {cc.ActionInterval} action
- * @return {cc.EaseExponentialInOut}
- *
- * @example
- * //The old usage
- * cc.EaseExponentialInOut.create(action);
- * //The new usage
- * action.easing(cc.easeExponentialInOut());
- */
cc.EaseExponentialInOut.create = function (action) {
return new cc.EaseExponentialInOut(action);
};
@@ -809,8 +524,8 @@ cc._easeExponentialInOutObj = {
/**
* creates an EaseExponentialInOut action easing object.
* Reference easeInOutExpo:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeExponentialInOut
* @return {Object}
* @example
* // example
@@ -820,12 +535,12 @@ cc.easeExponentialInOut = function(){
return cc._easeExponentialInOutObj;
};
-/**
+/*
* Ease Sine In.
* Reference easeInSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseSineIn
+ * @extends ActionEase
*
* @deprecated since v3.0 please use action.easing(cc.easeSineIn())
*
@@ -835,31 +550,16 @@ cc.easeExponentialInOut = function(){
* //The new usage
* action.easing(cc.easeSineIn());
*/
-cc.EaseSineIn = cc.ActionEase.extend(/** @lends cc.EaseSineIn# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseSineIn = cc.ActionEase.extend({
update:function (dt) {
dt = dt===0 || dt===1 ? dt : -1 * Math.cos(dt * Math.PI / 2) + 1;
this._inner.update(dt);
},
- /**
- * Create a cc.EaseSineOut action. Opposite with the original motion trajectory.
- * @return {cc.EaseSineOut}
- */
reverse:function () {
return new cc.EaseSineOut(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseSineIn}
- */
clone:function(){
var action = new cc.EaseSineIn();
action.initWithAction(this._inner.clone());
@@ -867,21 +567,6 @@ cc.EaseSineIn = cc.ActionEase.extend(/** @lends cc.EaseSineIn# */{
}
});
-/**
- * creates an EaseSineIn action.
- * Reference easeInSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeSineIn())
- * @param {cc.ActionInterval} action
- * @return {cc.EaseSineIn}
- *
- * @example
- * //The old usage
- * cc.EaseSineIn.create(action);
- * //The new usage
- * action.easing(cc.easeSineIn());
- */
cc.EaseSineIn.create = function (action) {
return new cc.EaseSineIn(action);
};
@@ -897,8 +582,8 @@ cc._easeSineInObj = {
/**
* creates an EaseSineIn action.
* Reference easeInSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeSineIn
* @return {Object}
* @example
* // example
@@ -908,12 +593,12 @@ cc.easeSineIn = function(){
return cc._easeSineInObj;
};
-/**
+/*
* Ease Sine Out.
* Reference easeOutSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseSineOut
+ * @extends ActionEase
*
* @deprecated since v3.0 please use action.easing(cc.easeSineOut())
*
@@ -923,31 +608,16 @@ cc.easeSineIn = function(){
* //The new usage
* action.easing(cc.easeSineOut());
*/
-cc.EaseSineOut = cc.ActionEase.extend(/** @lends cc.EaseSineOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseSineOut = cc.ActionEase.extend({
update:function (dt) {
dt = dt===0 || dt===1 ? dt : Math.sin(dt * Math.PI / 2);
this._inner.update(dt);
},
- /**
- * Create a cc.EaseSineIn action. Opposite with the original motion trajectory.
- * @return {cc.EaseSineIn}
- */
reverse:function () {
return new cc.EaseSineIn(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseSineOut}
- */
clone:function(){
var action = new cc.EaseSineOut();
action.initWithAction(this._inner.clone());
@@ -955,21 +625,6 @@ cc.EaseSineOut = cc.ActionEase.extend(/** @lends cc.EaseSineOut# */{
}
});
-/**
- * Creates an EaseSineOut action.
- * Reference easeOutSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeSineOut())
- * @param {cc.ActionInterval} action
- * @return {cc.EaseSineOut}
- *
- * @example
- * //The old usage
- * cc.EaseSineOut.create(action);
- * //The new usage
- * action.easing(cc.easeSineOut());
- */
cc.EaseSineOut.create = function (action) {
return new cc.EaseSineOut(action);
};
@@ -986,8 +641,8 @@ cc._easeSineOutObj = {
/**
* Creates an EaseSineOut action easing object.
* Reference easeOutSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeSineOut
* @return {Object}
* @example
* // example
@@ -997,12 +652,12 @@ cc.easeSineOut = function(){
return cc._easeSineOutObj;
};
-/**
+/*
* Ease Sine InOut.
* Reference easeInOutSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class cc.EaseSineInOut
+ * @extends ActionEase
*
* @deprecated since v3.0 please use action.easing(cc.easeSineInOut())
*
@@ -1012,53 +667,23 @@ cc.easeSineOut = function(){
* //The new usage
* action.easing(cc.easeSineInOut());
*/
-cc.EaseSineInOut = cc.ActionEase.extend(/** @lends cc.EaseSineInOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseSineInOut = cc.ActionEase.extend({
update:function (dt) {
dt = dt===0 || dt===1 ? dt : -0.5 * (Math.cos(Math.PI * dt) - 1);
this._inner.update(dt);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseSineInOut}
- */
clone:function(){
var action = new cc.EaseSineInOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a cc.EaseSineInOut action. Opposite with the original motion trajectory.
- * @return {cc.EaseSineInOut}
- */
reverse:function () {
return new cc.EaseSineInOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInOutSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- * @param {cc.ActionInterval} action
- * @return {cc.EaseSineInOut}
- * @deprecated since v3.0
Please use action.easing(cc.easeSineInOut())
- *
- * @example
- * //The old usage
- * cc.EaseSineInOut.create(action);
- * //The new usage
- * action.easing(cc.easeSineInOut());
- */
cc.EaseSineInOut.create = function (action) {
return new cc.EaseSineInOut(action);
};
@@ -1075,7 +700,8 @@ cc._easeSineInOutObj = {
/**
* creates the action easing object.
* Reference easeInOutSine:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeSineInOut
* @return {Object}
* @example
* // example
@@ -1087,22 +713,14 @@ cc.easeSineInOut = function(){
/**
* Ease Elastic abstract class.
- * @class
- * @extends cc.ActionEase
- * @param {cc.ActionInterval} action
+ * @class EaseElastic
+ * @extends ActionEase
+ * @param {ActionInterval} action
* @param {Number} [period=0.3]
- *
- * @deprecated since v3.0 Does not recommend the use of the base object.
*/
-cc.EaseElastic = cc.ActionEase.extend(/** @lends cc.EaseElastic# */{
+cc.EaseElastic = cc.ActionEase.extend({
_period: 0.3,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * Creates the action with the inner action and the period in radians (default is 0.3).
- * @param {cc.ActionInterval} action
- * @param {Number} [period=0.3]
- */
ctor:function(action, period){
cc.ActionEase.prototype.ctor.call(this);
@@ -1127,7 +745,7 @@ cc.EaseElastic = cc.ActionEase.extend(/** @lends cc.EaseElastic# */{
/**
* Initializes the action with the inner action and the period in radians (default is 0.3)
- * @param {cc.ActionInterval} action
+ * @param {ActionInterval} action
* @param {Number} [period=0.3]
* @return {Boolean}
*/
@@ -1137,22 +755,11 @@ cc.EaseElastic = cc.ActionEase.extend(/** @lends cc.EaseElastic# */{
return true;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * Will be overwrite.
- * @return {null}
- */
reverse:function () {
cc.log("cc.EaseElastic.reverse(): it should be overridden in subclass.");
return null;
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseElastic}
- */
clone:function(){
var action = new cc.EaseElastic();
action.initWithAction(this._inner.clone(), this._period);
@@ -1160,25 +767,21 @@ cc.EaseElastic = cc.ActionEase.extend(/** @lends cc.EaseElastic# */{
}
});
-/**
- * Creates the action with the inner action and the period in radians (default is 0.3).
- * @static
- * @deprecated since v3.0 Does not recommend the use of the base object.
- * @param {cc.ActionInterval} action
- * @param {Number} [period=0.3]
- * @return {cc.EaseElastic}
- */
cc.EaseElastic.create = function (action, period) {
return new cc.EaseElastic(action, period);
};
/**
+ * @module actions
+ */
+
+/*
* Ease Elastic In action.
* Reference easeInElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
+ * http://www.zhihu.com/question/21981571/answer/19925418
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.EaseElastic
+ * @class EaseElasticIn
+ * @extends EaseElastic
*
* @deprecated since v3.0 please use action.easing(cc.easeElasticIn())
*
@@ -1188,12 +791,7 @@ cc.EaseElastic.create = function (action, period) {
* //The new usage
* action.easing(cc.easeElasticIn(period));
*/
-cc.EaseElasticIn = cc.EaseElastic.extend(/** @lends cc.EaseElasticIn# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseElasticIn = cc.EaseElastic.extend({
update:function (dt) {
var newT = 0;
if (dt === 0 || dt === 1) {
@@ -1206,20 +804,10 @@ cc.EaseElasticIn = cc.EaseElastic.extend(/** @lends cc.EaseElasticIn# */{
this._inner.update(newT);
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseElasticOut}
- */
reverse:function () {
return new cc.EaseElasticOut(this._inner.reverse(), this._period);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseElasticIn}
- */
clone:function(){
var action = new cc.EaseElasticIn();
action.initWithAction(this._inner.clone(), this._period);
@@ -1227,22 +815,6 @@ cc.EaseElasticIn = cc.EaseElastic.extend(/** @lends cc.EaseElasticIn# */{
}
});
-/**
- * Creates the action with the inner action and the period in radians (default is 0.3).
- * Reference easeInElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @deprecated since v3.0
Please use action.easing(cc.easeElasticIn(period))
- *
- * @example
- * //The old usage
- * cc.EaseElasticIn.create(action, period);
- * //The new usage
- * action.easing(cc.easeElasticIn(period));
- *
- * @param {cc.ActionInterval} action
- * @param {Number} [period=0.3]
- * @return {cc.EaseElasticIn}
- */
cc.EaseElasticIn.create = function (action, period) {
return new cc.EaseElasticIn(action, period);
};
@@ -1263,8 +835,8 @@ cc._easeElasticInObj = {
/**
* Creates the action easing obejct with the period in radians (default is 0.3).
* Reference easeInElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeElasticIn
* @param {Number} [period=0.3]
* @return {Object}
* @example
@@ -1289,13 +861,13 @@ cc.easeElasticIn = function (period) {
return cc._easeElasticInObj;
};
-/**
+/*
* Ease Elastic Out action.
* Reference easeOutElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
+ * http://www.zhihu.com/question/21981571/answer/19925418
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.EaseElastic
+ * @class EaseElasticOut
+ * @extends EaseElastic
*
* @deprecated since v3.0
Please use action.easing(cc.easeElasticOut(period))
*
@@ -1305,12 +877,7 @@ cc.easeElasticIn = function (period) {
* //The new usage
* action.easing(cc.easeElasticOut(period));
*/
-cc.EaseElasticOut = cc.EaseElastic.extend(/** @lends cc.EaseElasticOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseElasticOut = cc.EaseElastic.extend({
update:function (dt) {
var newT = 0;
if (dt === 0 || dt === 1) {
@@ -1323,20 +890,10 @@ cc.EaseElasticOut = cc.EaseElastic.extend(/** @lends cc.EaseElasticOut# */{
this._inner.update(newT);
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseElasticIn}
- */
reverse:function () {
return new cc.EaseElasticIn(this._inner.reverse(), this._period);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseElasticOut}
- */
clone:function(){
var action = new cc.EaseElasticOut();
action.initWithAction(this._inner.clone(), this._period);
@@ -1344,21 +901,6 @@ cc.EaseElasticOut = cc.EaseElastic.extend(/** @lends cc.EaseElasticOut# */{
}
});
-/**
- * Creates the action with the inner action and the period in radians (default is 0.3).
- * Reference easeOutElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @deprecated since v3.0
Please use action.easing(cc.easeElasticOut(period))
- * @param {cc.ActionInterval} action
- * @param {Number} [period=0.3]
- * @return {cc.EaseElasticOut}
- *
- * @example
- * //The old usage
- * cc.EaseElasticOut.create(action, period);
- * //The new usage
- * action.easing(cc.easeElasticOut(period));
- */
cc.EaseElasticOut.create = function (action, period) {
return new cc.EaseElasticOut(action, period);
};
@@ -1375,8 +917,8 @@ cc._easeElasticOutObj = {
/**
* Creates the action easing object with the period in radians (default is 0.3).
* Reference easeOutElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeElasticOut
* @param {Number} [period=0.3]
* @return {Object}
* @example
@@ -1398,13 +940,13 @@ cc.easeElasticOut = function (period) {
return cc._easeElasticOutObj;
};
-/**
+/*
* Ease Elastic InOut action.
* Reference easeInOutElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
+ * http://www.zhihu.com/question/21981571/answer/19925418
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.EaseElastic
+ * @class EaseElasticInOut
+ * @extends EaseElastic
*
* @deprecated since v3.0 please use action.easing(cc.easeElasticInOut())
*
@@ -1414,12 +956,7 @@ cc.easeElasticOut = function (period) {
* //The new usage
* action.easing(cc.easeElasticInOut(period));
*/
-cc.EaseElasticInOut = cc.EaseElastic.extend(/** @lends cc.EaseElasticInOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseElasticInOut = cc.EaseElastic.extend({
update:function (dt) {
var newT = 0;
var locPeriod = this._period;
@@ -1440,20 +977,10 @@ cc.EaseElasticInOut = cc.EaseElastic.extend(/** @lends cc.EaseElasticInOut# */{
this._inner.update(newT);
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseElasticInOut}
- */
reverse:function () {
return new cc.EaseElasticInOut(this._inner.reverse(), this._period);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseElasticInOut}
- */
clone:function(){
var action = new cc.EaseElasticInOut();
action.initWithAction(this._inner.clone(), this._period);
@@ -1461,21 +988,6 @@ cc.EaseElasticInOut = cc.EaseElastic.extend(/** @lends cc.EaseElasticInOut# */{
}
});
-/**
- * Creates the action with the inner action and the period in radians (default is 0.3).
- * Reference easeInOutElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @deprecated since v3.0
Please use action.easing(cc.easeElasticInOut(period))
- * @param {cc.ActionInterval} action
- * @param {Number} [period=0.3]
- * @return {cc.EaseElasticInOut}
- *
- * @example
- * //The old usage
- * cc.EaseElasticInOut.create(action, period);
- * //The new usage
- * action.easing(cc.easeElasticInOut(period));
- */
cc.EaseElasticInOut.create = function (action, period) {
return new cc.EaseElasticInOut(action, period);
};
@@ -1483,8 +995,8 @@ cc.EaseElasticInOut.create = function (action, period) {
/**
* Creates the action easing object with the period in radians (default is 0.3).
* Reference easeInOutElastic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeElasticInOut
* @param {Number} [period=0.3]
* @return {Object}
* @example
@@ -1522,12 +1034,10 @@ cc.easeElasticInOut = function (period) {
/**
* cc.EaseBounce abstract class.
*
- * @deprecated since v3.0 Does not recommend the use of the base object.
- *
- * @class
- * @extends cc.ActionEase
+ * @class EaseBounce
+ * @extends ActionEase
*/
-cc.EaseBounce = cc.ActionEase.extend(/** @lends cc.EaseBounce# */{
+cc.EaseBounce = cc.ActionEase.extend({
/**
* @param {Number} time1
* @return {Number}
@@ -1547,44 +1057,31 @@ cc.EaseBounce = cc.ActionEase.extend(/** @lends cc.EaseBounce# */{
return 7.5625 * time1 * time1 + 0.984375;
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseBounce}
- */
clone:function(){
var action = new cc.EaseBounce();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseBounce}
- */
reverse:function () {
return new cc.EaseBounce(this._inner.reverse());
}
});
-/**
- * Creates an ease bounce action.
- * @static
- * @deprecated since v3.0 Does not recommend the use of the base object.
- * @param {cc.ActionInterval} action
- * @return {cc.EaseBounce}
- */
cc.EaseBounce.create = function (action) {
return new cc.EaseBounce(action);
};
/**
+ * @module actions
+ */
+
+/*
* cc.EaseBounceIn action.
* Eased bounce effect at the beginning.
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.EaseBounce
+ * @class EaseBounceIn
+ * @extends EaseBounce
*
* @deprecated since v3.0 please use action.easing(cc.easeBounceIn())
*
@@ -1594,31 +1091,16 @@ cc.EaseBounce.create = function (action) {
* //The new usage
* action.easing(cc.easeBounceIn());
*/
-cc.EaseBounceIn = cc.EaseBounce.extend(/** @lends cc.EaseBounceIn# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseBounceIn = cc.EaseBounce.extend({
update:function (dt) {
var newT = 1 - this.bounceTime(1 - dt);
this._inner.update(newT);
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseBounceOut}
- */
reverse:function () {
return new cc.EaseBounceOut(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseBounceIn}
- */
clone:function(){
var action = new cc.EaseBounceIn();
action.initWithAction(this._inner.clone());
@@ -1626,20 +1108,6 @@ cc.EaseBounceIn = cc.EaseBounce.extend(/** @lends cc.EaseBounceIn# */{
}
});
-/**
- * Creates the action.
- * Eased bounce effect at the beginning.
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeBounceIn())
- * @param {cc.ActionInterval} action
- * @return {cc.EaseBounceIn}
- *
- * @example
- * //The old usage
- * cc.EaseBounceIn.create(action);
- * //The new usage
- * action.easing(cc.easeBounceIn());
- */
cc.EaseBounceIn.create = function (action) {
return new cc.EaseBounceIn(action);
};
@@ -1671,7 +1139,7 @@ cc._easeBounceInObj = {
/**
* Creates the action easing object.
* Eased bounce effect at the beginning.
- * @function
+ * @method cc.easeBounceIn
* @return {Object}
* @example
* // example
@@ -1681,12 +1149,12 @@ cc.easeBounceIn = function(){
return cc._easeBounceInObj;
};
-/**
+/*
* cc.EaseBounceOut action.
* Eased bounce effect at the ending.
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.EaseBounce
+ * @class EaseBounceOut
+ * @extends EaseBounce
*
* @deprecated since v3.0 please use action.easing(cc.easeBounceOut())
*
@@ -1696,31 +1164,16 @@ cc.easeBounceIn = function(){
* //The new usage
* action.easing(cc.easeBounceOut());
*/
-cc.EaseBounceOut = cc.EaseBounce.extend(/** @lends cc.EaseBounceOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseBounceOut = cc.EaseBounce.extend({
update:function (dt) {
var newT = this.bounceTime(dt);
this._inner.update(newT);
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseBounceIn}
- */
reverse:function () {
return new cc.EaseBounceIn(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseBounceOut}
- */
clone:function(){
var action = new cc.EaseBounceOut();
action.initWithAction(this._inner.clone());
@@ -1728,20 +1181,6 @@ cc.EaseBounceOut = cc.EaseBounce.extend(/** @lends cc.EaseBounceOut# */{
}
});
-/**
- * Creates the action.
- * Eased bounce effect at the ending.
- * @static
- * @deprecated since v3.0 please use action.easing(cc.easeBounceOut())
- * @param {cc.ActionInterval} action
- * @return {cc.EaseBounceOut}
- *
- * @example
- * //The old usage
- * cc.EaseBounceOut.create(action);
- * //The new usage
- * action.easing(cc.easeBounceOut());
- */
cc.EaseBounceOut.create = function (action) {
return new cc.EaseBounceOut(action);
};
@@ -1758,7 +1197,7 @@ cc._easeBounceOutObj = {
/**
* Creates the action easing object.
* Eased bounce effect at the ending.
- * @function
+ * @method cc.easeBounceOut
* @return {Object}
* @example
* // example
@@ -1768,12 +1207,12 @@ cc.easeBounceOut = function(){
return cc._easeBounceOutObj;
};
-/**
+/*
* cc.EaseBounceInOut action.
* Eased bounce effect at the begining and ending.
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.EaseBounce
+ * @class EaseBounceInOut
+ * @extends EaseBounce
*
* @deprecated since v3.0
Please use acton.easing(cc.easeBounceInOut())
*
@@ -1783,12 +1222,7 @@ cc.easeBounceOut = function(){
* //The new usage
* action.easing(cc.easeBounceInOut());
*/
-cc.EaseBounceInOut = cc.EaseBounce.extend(/** @lends cc.EaseBounceInOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseBounceInOut = cc.EaseBounce.extend({
update:function (dt) {
var newT = 0;
if (dt < 0.5) {
@@ -1800,41 +1234,17 @@ cc.EaseBounceInOut = cc.EaseBounce.extend(/** @lends cc.EaseBounceInOut# */{
this._inner.update(newT);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseBounceInOut}
- */
clone:function(){
var action = new cc.EaseBounceInOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseBounceInOut}
- */
reverse:function () {
return new cc.EaseBounceInOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Eased bounce effect at the begining and ending.
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeBounceInOut())
- * @param {cc.ActionInterval} action
- * @return {cc.EaseBounceInOut}
- *
- * @example
- * //The old usage
- * cc.EaseBounceInOut.create(action);
- * //The new usage
- * action.easing(cc.easeBounceInOut());
- */
cc.EaseBounceInOut.create = function (action) {
return new cc.EaseBounceInOut(action);
};
@@ -1858,7 +1268,7 @@ cc._easeBounceInOutObj = {
/**
* Creates the action easing object.
* Eased bounce effect at the begining and ending.
- * @function
+ * @method cc.easeBounceInOut
* @return {Object}
* @example
* // example
@@ -1868,12 +1278,12 @@ cc.easeBounceInOut = function(){
return cc._easeBounceInOutObj;
};
-/**
+/*
* cc.EaseBackIn action.
* In the opposite direction to move slowly, and then accelerated to the right direction.
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.ActionEase
+ * @class EaseBackIn
+ * @extends ActionEase
*
* @deprecated since v3.0 please use action.easing(cc.easeBackIn())
*
@@ -1883,32 +1293,17 @@ cc.easeBounceInOut = function(){
* //The new usage
* action.easing(cc.easeBackIn());
*/
-cc.EaseBackIn = cc.ActionEase.extend(/** @lends cc.EaseBackIn# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseBackIn = cc.ActionEase.extend({
update:function (dt) {
var overshoot = 1.70158;
dt = dt===0 || dt===1 ? dt : dt * dt * ((overshoot + 1) * dt - overshoot);
this._inner.update(dt);
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseBackOut}
- */
reverse:function () {
return new cc.EaseBackOut(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseBackIn}
- */
clone:function(){
var action = new cc.EaseBackIn();
action.initWithAction(this._inner.clone());
@@ -1916,21 +1311,6 @@ cc.EaseBackIn = cc.ActionEase.extend(/** @lends cc.EaseBackIn# */{
}
});
-
-/**
- * Creates the cc.EaseBackIn.
- * In the opposite direction to move slowly, and then accelerated to the right direction.
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeBackIn())
- * @param {cc.ActionInterval} action
- * @return {cc.EaseBackIn}
- *
- * @example
- * //The old usage
- * cc.EaseBackIn.create(action);
- * //The new usage
- * action.easing(cc.easeBackIn());
- */
cc.EaseBackIn.create = function (action) {
return new cc.EaseBackIn(action);
};
@@ -1948,7 +1328,7 @@ cc._easeBackInObj = {
/**
* Creates the action easing object.
* In the opposite direction to move slowly, and then accelerated to the right direction.
- * @function
+ * @method cc.easeBackIn
* @return {Object}
* @example
* // example
@@ -1958,12 +1338,12 @@ cc.easeBackIn = function(){
return cc._easeBackInObj;
};
-/**
+/*
* cc.EaseBackOut action.
* Fast moving more than the finish, and then slowly back to the finish.
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.ActionEase
+ * @class EaseBackOut
+ * @extends ActionEase
*
* @deprecated since v3.0 please use action.easing(cc.easeBackOut());
*
@@ -1973,32 +1353,17 @@ cc.easeBackIn = function(){
* //The new usage
* action.easing(cc.easeBackOut());
*/
-cc.EaseBackOut = cc.ActionEase.extend(/** @lends cc.EaseBackOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseBackOut = cc.ActionEase.extend({
update:function (dt) {
var overshoot = 1.70158;
dt = dt - 1;
this._inner.update(dt * dt * ((overshoot + 1) * dt + overshoot) + 1);
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseBackIn}
- */
reverse:function () {
return new cc.EaseBackIn(this._inner.reverse());
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseBackOut}
- */
clone:function(){
var action = new cc.EaseBackOut();
action.initWithAction(this._inner.clone());
@@ -2006,20 +1371,6 @@ cc.EaseBackOut = cc.ActionEase.extend(/** @lends cc.EaseBackOut# */{
}
});
-/**
- * Creates the action.
- * Fast moving more than the finish, and then slowly back to the finish.
- * @static
- * @deprecated since v3.0
Please use action.easing(cc.easeBackOut());
- * @param {cc.ActionInterval} action
- * @return {cc.EaseBackOut}
- *
- * @example
- * //The old usage
- * cc.EaseBackOut.create(action);
- * //The new usage
- * action.easing(cc.easeBackOut());
- */
cc.EaseBackOut.create = function (action) {
return new cc.EaseBackOut(action);
};
@@ -2038,7 +1389,7 @@ cc._easeBackOutObj = {
/**
* Creates the action easing object.
* Fast moving more than the finish, and then slowly back to the finish.
- * @function
+ * @method cc.easeBackOut
* @return {Object}
* @example
* // example
@@ -2048,12 +1399,12 @@ cc.easeBackOut = function(){
return cc._easeBackOutObj;
};
-/**
+/*
* cc.EaseBackInOut action.
* Begining of cc.EaseBackIn. Ending of cc.EaseBackOut.
* @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
- * @class
- * @extends cc.ActionEase
+ * @class EaseBackInOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeBackInOut())
*
@@ -2063,12 +1414,7 @@ cc.easeBackOut = function(){
* //The new usage
* action.easing(cc.easeBackInOut());
*/
-cc.EaseBackInOut = cc.ActionEase.extend(/** @lends cc.EaseBackInOut# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+cc.EaseBackInOut = cc.ActionEase.extend({
update:function (dt) {
var overshoot = 1.70158 * 1.525;
dt = dt * 2;
@@ -2080,43 +1426,17 @@ cc.EaseBackInOut = cc.ActionEase.extend(/** @lends cc.EaseBackInOut# */{
}
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseBackInOut}
- */
clone:function(){
var action = new cc.EaseBackInOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseBackInOut}
- */
reverse:function () {
return new cc.EaseBackInOut(this._inner.reverse());
}
});
-
-/**
- * Creates the action.
- * Begining of cc.EaseBackIn. Ending of cc.EaseBackOut.
- * @static
- * @param {cc.ActionInterval} action
- * @return {cc.EaseBackInOut}
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeBackInOut())
- *
- * @example
- * //The old usage
- * cc.EaseBackInOut.create(action);
- * //The new usage
- * action.easing(cc.easeBackInOut());
- */
cc.EaseBackInOut.create = function (action) {
return new cc.EaseBackInOut(action);
};
@@ -2140,7 +1460,7 @@ cc._easeBackInOutObj = {
/**
* Creates the action easing object.
* Begining of cc.EaseBackIn. Ending of cc.EaseBackOut.
- * @function
+ * @method cc.easeBackInOut
* @return {Object}
* @example
* // example
@@ -2150,13 +1470,13 @@ cc.easeBackInOut = function(){
return cc._easeBackInOutObj;
};
-/**
+/*
* cc.EaseBezierAction action.
* Manually set a 4 order Bessel curve.
* According to the set point, calculate the trajectory.
- * @class
- * @extends cc.ActionEase
- * @param {cc.Action} action
+ * @class EaseBezierAction
+ * @extends ActionEase
+ * @param {Action} action
*
* @deprecated since v3.0
Please use action.easing(cc.easeBezierAction())
*
@@ -2167,7 +1487,7 @@ cc.easeBackInOut = function(){
* //The new usage
* action.easing(cc.easeBezierAction(0.5, 0.5, 1.0, 1.0));
*/
-cc.EaseBezierAction = cc.ActionEase.extend(/** @lends cc.EaseBezierAction# */{
+cc.EaseBezierAction = cc.ActionEase.extend({
_p0: null,
_p1: null,
@@ -2177,7 +1497,7 @@ cc.EaseBezierAction = cc.ActionEase.extend(/** @lends cc.EaseBezierAction# */{
/**
* Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
* Initialization requires the application of Bessel curve of action.
- * @param {cc.Action} action
+ * @param {Action} action
*/
ctor: function(action){
cc.ActionEase.prototype.ctor.call(this, action);
@@ -2187,22 +1507,11 @@ cc.EaseBezierAction = cc.ActionEase.extend(/** @lends cc.EaseBezierAction# */{
return (Math.pow(1-t,3) * a + 3*t*(Math.pow(1-t,2))*b + 3*Math.pow(t,2)*(1-t)*c + Math.pow(t,3)*d );
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
var t = this._updateTime(this._p0, this._p1, this._p2, this._p3, dt);
this._inner.update(t);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseBezierAction}
- */
clone: function(){
var action = new cc.EaseBezierAction();
action.initWithAction(this._inner.clone());
@@ -2210,10 +1519,6 @@ cc.EaseBezierAction = cc.ActionEase.extend(/** @lends cc.EaseBezierAction# */{
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseBezierAction}
- */
reverse: function(){
var action = new cc.EaseBezierAction(this._inner.reverse());
action.setBezierParamer(this._p3, this._p2, this._p1, this._p0);
@@ -2235,23 +1540,6 @@ cc.EaseBezierAction = cc.ActionEase.extend(/** @lends cc.EaseBezierAction# */{
}
});
-/**
- * Creates the action.
- * After creating the cc.EaseBezierAction, also need to manually call setBezierParamer.
- * According to the set point, calculate the trajectory.
- * @static
- * @param action
- * @returns {cc.EaseBezierAction}
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeBezierAction())
- *
- * @example
- * //The old usage
- * var action = cc.EaseBezierAction.create(action);
- * action.setBezierParamer(0.5, 0.5, 1.0, 1.0);
- * //The new usage
- * action.easing(cc.easeBezierAction(0.5, 0.5, 1.0, 1.0));
- */
cc.EaseBezierAction.create = function(action){
return new cc.EaseBezierAction(action);
};
@@ -2260,6 +1548,7 @@ cc.EaseBezierAction.create = function(action){
* Creates the action easing object.
* Into the 4 reference point.
* To calculate the motion curve.
+ * @method cc.easeBezierAction
* @param {Number} p0 The first bezier parameter
* @param {Number} p1 The second bezier parameter
* @param {Number} p2 The third bezier parameter
@@ -2280,12 +1569,12 @@ cc.easeBezierAction = function(p0, p1, p2, p3){
};
};
-/**
+/*
* cc.EaseQuadraticActionIn action.
* Reference easeInQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuadraticActionIn
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeQuadraticAction())
*
@@ -2295,59 +1584,28 @@ cc.easeBezierAction = function(p0, p1, p2, p3){
* //The new usage
* action.easing(cc.easeQuadraticActionIn());
*/
-cc.EaseQuadraticActionIn = cc.ActionEase.extend(/** @lends cc.EaseQuadraticActionIn# */{
+cc.EaseQuadraticActionIn = cc.ActionEase.extend({
_updateTime: function(time){
return Math.pow(time, 2);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuadraticActionIn}
- */
clone: function(){
var action = new cc.EaseQuadraticActionIn();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuadraticActionIn}
- */
reverse: function(){
return new cc.EaseQuadraticActionIn(this._inner.reverse());
}
});
-/**
- * Creates the cc.EaseQuadRaticActionIn.
- * Reference easeInQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- * @param action
- * @returns {cc.EaseQuadraticActionIn}
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeQuadraticAction())
- *
- * @example
- * //The old usage
- * cc.EaseQuadraticActionIn.create(action);
- * //The new usage
- * action.easing(cc.easeQuadraticActionIn());
- */
cc.EaseQuadraticActionIn.create = function(action){
return new cc.EaseQuadraticActionIn(action);
};
@@ -2362,7 +1620,8 @@ cc._easeQuadraticActionIn = {
/**
* Creates the action easing object.
* Reference easeInQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuadraticActionIn
* @returns {Object}
* @example
* //example
@@ -2372,12 +1631,12 @@ cc.easeQuadraticActionIn = function(){
return cc._easeQuadraticActionIn;
};
-/**
+/*
* cc.EaseQuadraticActionIn action.
* Reference easeOutQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuadraticActionOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionOut())
*
@@ -2387,58 +1646,27 @@ cc.easeQuadraticActionIn = function(){
* //The new usage
* action.easing(cc.easeQuadraticActionOut());
*/
-cc.EaseQuadraticActionOut = cc.ActionEase.extend(/** @lends cc.EaseQuadraticActionOut# */{
+cc.EaseQuadraticActionOut = cc.ActionEase.extend({
_updateTime: function(time){
return -time*(time-2);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuadraticActionOut}
- */
clone: function(){
var action = new cc.EaseQuadraticActionOut();
action.initWithAction();
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuadraticActionOut}
- */
reverse: function(){
return new cc.EaseQuadraticActionOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeOutQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- * @param action
- * @returns {cc.EaseQuadraticActionOut}
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionOut())
- *
- * @example
- * //The old usage
- * cc.EaseQuadraticActionOut.create(action);
- * //The new usage
- * action.easing(cc.easeQuadraticActionOut());
- */
cc.EaseQuadraticActionOut.create = function(action){
return new cc.EaseQuadraticActionOut(action);
};
@@ -2452,8 +1680,8 @@ cc._easeQuadraticActionOut = {
/**
* Creates the action easing object.
* Reference easeOutQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuadraticActionOut
* @returns {Object}
* @example
* //example
@@ -2463,12 +1691,12 @@ cc.easeQuadraticActionOut = function(){
return cc._easeQuadraticActionOut;
};
-/**
+/*
* cc.EaseQuadraticActionInOut action.
* Reference easeInOutQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuadraticActionInOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionInOut())
*
@@ -2478,7 +1706,7 @@ cc.easeQuadraticActionOut = function(){
* //The new usage
* action.easing(cc.easeQuadraticActionInOut());
*/
-cc.EaseQuadraticActionInOut = cc.ActionEase.extend(/** @lends cc.EaseQuadraticActionInOut# */{
+cc.EaseQuadraticActionInOut = cc.ActionEase.extend({
_updateTime: function(time){
var resultTime = time;
time *= 2;
@@ -2491,53 +1719,21 @@ cc.EaseQuadraticActionInOut = cc.ActionEase.extend(/** @lends cc.EaseQuadraticAc
return resultTime;
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuadraticActionInOut}
- */
clone: function(){
var action = new cc.EaseQuadraticActionInOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuadraticActionInOut}
- */
reverse: function(){
return new cc.EaseQuadraticActionInOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInOutQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionInOut())
- *
- * @example
- * //The old usage
- * cc.EaseQuadraticActionInOut.create(action);
- * //The new usage
- * action.easing(cc.easeQuadraticActionInOut());
- *
- * @param action
- * @returns {cc.EaseQuadraticActionInOut}
- */
cc.EaseQuadraticActionInOut.create = function(action){
return new cc.EaseQuadraticActionInOut(action);
};
@@ -2552,8 +1748,8 @@ cc._easeQuadraticActionInOut = {
/**
* Creates the action easing object.
* Reference easeInOutQuad:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuadraticActionInOut
* @returns {Object}
* @example
* //example
@@ -2563,12 +1759,12 @@ cc.easeQuadraticActionInOut = function(){
return cc._easeQuadraticActionInOut;
};
-/**
+/*
* cc.EaseQuarticActionIn action.
* Reference easeInQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuarticActionIn
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeQuarticActionIn());
*
@@ -2578,58 +1774,26 @@ cc.easeQuadraticActionInOut = function(){
* //The new usage
* action.easing(cc.easeQuarticActionIn());
*/
-cc.EaseQuarticActionIn = cc.ActionEase.extend(/** @lends cc.EaseQuarticActionIn# */{
+cc.EaseQuarticActionIn = cc.ActionEase.extend({
_updateTime: function(time){
return time * time * time * time;
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuarticActionIn}
- */
clone: function(){
var action = new cc.EaseQuarticActionIn();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuarticActionIn}
- */
reverse: function(){
return new cc.EaseQuarticActionIn(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeQuarticActionIn());
- *
- * @example
- * //The old usage
- * cc.EaseQuarticActionIn.create(action);
- * //The new usage
- * action.easing(cc.easeQuarticActionIn());
- *
- * @param action
- * @returns {cc.EaseQuarticActionIn}
- */
cc.EaseQuarticActionIn.create = function(action){
return new cc.EaseQuarticActionIn(action);
};
@@ -2643,8 +1807,8 @@ cc._easeQuarticActionIn = {
/**
* Creates the action easing object.
* Reference easeIntQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuarticActionIn
* @returns {Object}
* @example
* //example
@@ -2654,12 +1818,12 @@ cc.easeQuarticActionIn = function(){
return cc._easeQuarticActionIn;
};
-/**
+/*
* cc.EaseQuarticActionOut action.
* Reference easeOutQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuarticActionOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.QuarticActionOut());
*
@@ -2669,59 +1833,27 @@ cc.easeQuarticActionIn = function(){
* //The new usage
* action.easing(cc.EaseQuarticActionOut());
*/
-cc.EaseQuarticActionOut = cc.ActionEase.extend(/** @lends cc.EaseQuarticActionOut# */{
+cc.EaseQuarticActionOut = cc.ActionEase.extend({
_updateTime: function(time){
time -= 1;
return -(time * time * time * time - 1);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuarticActionOut}
- */
clone: function(){
var action = new cc.EaseQuarticActionOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuarticActionOut}
- */
reverse: function(){
return new cc.EaseQuarticActionOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeOutQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.QuarticActionOut());
- *
- * @example
- * //The old usage
- * cc.EaseQuarticActionOut.create(action);
- * //The new usage
- * action.easing(cc.EaseQuarticActionOut());
- *
- * @param action
- * @returns {cc.EaseQuarticActionOut}
- */
cc.EaseQuarticActionOut.create = function(action){
return new cc.EaseQuarticActionOut(action);
};
@@ -2736,8 +1868,8 @@ cc._easeQuarticActionOut = {
/**
* Creates the action easing object.
* Reference easeOutQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuarticActionOut
* @returns {Object}
* @example
* //example
@@ -2747,12 +1879,12 @@ cc.easeQuarticActionOut = function(){
return cc._easeQuarticActionOut;
};
-/**
+/*
* cc.EaseQuarticActionInOut action.
* Reference easeInOutQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuarticActionInOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeQuarticActionInOut());
*
@@ -2762,7 +1894,7 @@ cc.easeQuarticActionOut = function(){
* //The new usage
* action.easing(cc.easeQuarticActionInOut());
*/
-cc.EaseQuarticActionInOut = cc.ActionEase.extend(/** @lends cc.EaseQuarticActionInOut# */{
+cc.EaseQuarticActionInOut = cc.ActionEase.extend({
_updateTime: function(time){
time = time*2;
if (time < 1)
@@ -2771,53 +1903,21 @@ cc.EaseQuarticActionInOut = cc.ActionEase.extend(/** @lends cc.EaseQuarticAction
return -0.5 * (time * time * time * time - 2);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuarticActionInOut}
- */
clone: function(){
var action = new cc.EaseQuarticActionInOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuarticActionInOut}
- */
reverse: function(){
return new cc.EaseQuarticActionInOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInOutQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeQuarticActionInOut());
- *
- * @example
- * //The old usage
- * cc.EaseQuarticActionInOut.create(action);
- * //The new usage
- * action.easing(cc.easeQuarticActionInOut());
- *
- * @param action
- * @returns {cc.EaseQuarticActionInOut}
- */
cc.EaseQuarticActionInOut.create = function(action){
return new cc.EaseQuarticActionInOut(action);
};
@@ -2831,20 +1931,20 @@ cc._easeQuarticActionInOut = {
/**
* Creates the action easing object.
* Reference easeInOutQuart:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuarticActionInOut
* @returns {Object}
*/
cc.easeQuarticActionInOut = function(){
return cc._easeQuarticActionInOut;
};
-/**
+/*
* cc.EaseQuinticActionIn action.
* Reference easeInQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuinticActionIn
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeQuinticActionIn());
*
@@ -2854,58 +1954,26 @@ cc.easeQuarticActionInOut = function(){
* //The new usage
* action.easing(cc.easeQuinticActionIn());
*/
-cc.EaseQuinticActionIn = cc.ActionEase.extend(/** @lends cc.EaseQuinticActionIn# */{
+cc.EaseQuinticActionIn = cc.ActionEase.extend({
_updateTime: function(time){
return time * time * time * time * time;
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuinticActionIn}
- */
clone: function(){
var action = new cc.EaseQuinticActionIn();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuinticActionIn}
- */
reverse: function(){
return new cc.EaseQuinticActionIn(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeQuinticActionIn());
- *
- * @example
- * //The old usage
- * cc.EaseQuinticActionIn.create(action);
- * //The new usage
- * action.easing(cc.easeQuinticActionIn());
- *
- * @param action
- * @returns {cc.EaseQuinticActionIn}
- */
cc.EaseQuinticActionIn.create = function(action){
return new cc.EaseQuinticActionIn(action);
};
@@ -2920,8 +1988,8 @@ cc._easeQuinticActionIn = {
/**
* Creates the action easing object.
* Reference easeInQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuinticActionIn
* @returns {Object}
* @example
* //example
@@ -2931,12 +1999,12 @@ cc.easeQuinticActionIn = function(){
return cc._easeQuinticActionIn;
};
-/**
+/*
* cc.EaseQuinticActionOut action.
* Reference easeQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuinticActionOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionOut());
*
@@ -2946,59 +2014,27 @@ cc.easeQuinticActionIn = function(){
* //The new usage
* action.easing(cc.easeQuadraticActionOut());
*/
-cc.EaseQuinticActionOut = cc.ActionEase.extend(/** @lends cc.EaseQuinticActionOut# */{
+cc.EaseQuinticActionOut = cc.ActionEase.extend({
_updateTime: function(time){
time -=1;
return (time * time * time * time * time + 1);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuinticActionOut}
- */
clone: function(){
var action = new cc.EaseQuinticActionOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuinticActionOut}
- */
reverse: function(){
return new cc.EaseQuinticActionOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeOutQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeQuadraticActionOut());
- *
- * @example
- * //The old usage
- * cc.EaseQuinticActionOut.create(action);
- * //The new usage
- * action.easing(cc.easeQuadraticActionOut());
- *
- * @param action
- * @returns {cc.EaseQuinticActionOut}
- */
cc.EaseQuinticActionOut.create = function(action){
return new cc.EaseQuinticActionOut(action);
};
@@ -3013,8 +2049,8 @@ cc._easeQuinticActionOut = {
/**
* Creates the action easing object.
* Reference easeOutQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuinticActionOut
* @returns {Object}
* @example
* //example
@@ -3024,12 +2060,12 @@ cc.easeQuinticActionOut = function(){
return cc._easeQuinticActionOut;
};
-/**
+/*
* cc.EaseQuinticActionInOut action.
* Reference easeInOutQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseQuinticActionInOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeQuinticActionInOut());
*
@@ -3039,7 +2075,7 @@ cc.easeQuinticActionOut = function(){
* //The new usage
* action.easing(cc.easeQuinticActionInOut());
*/
-cc.EaseQuinticActionInOut = cc.ActionEase.extend(/** @lends cc.EaseQuinticActionInOut# */{
+cc.EaseQuinticActionInOut = cc.ActionEase.extend({
_updateTime: function(time){
time = time*2;
if (time < 1)
@@ -3048,53 +2084,21 @@ cc.EaseQuinticActionInOut = cc.ActionEase.extend(/** @lends cc.EaseQuinticAction
return 0.5 * (time * time * time * time * time + 2);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseQuinticActionInOut}
- */
clone: function(){
var action = new cc.EaseQuinticActionInOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseQuinticActionInOut}
- */
reverse: function(){
return new cc.EaseQuinticActionInOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInOutQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeQuinticActionInOut());
- *
- * @example
- * //The old usage
- * cc.EaseQuinticActionInOut.create(action);
- * //The new usage
- * action.easing(cc.easeQuinticActionInOut());
- *
- * @param action
- * @returns {cc.EaseQuinticActionInOut}
- */
cc.EaseQuinticActionInOut.create = function(action){
return new cc.EaseQuinticActionInOut(action);
};
@@ -3109,8 +2113,8 @@ cc._easeQuinticActionInOut = {
/**
* Creates the action easing object.
* Reference easeInOutQuint:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeQuinticActionInOut
* @returns {Object}
* @example
* //example
@@ -3120,12 +2124,12 @@ cc.easeQuinticActionInOut = function(){
return cc._easeQuinticActionInOut;
};
-/**
+/*
* cc.EaseCircleActionIn action.
* Reference easeInCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseCircleActionIn
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeCircleActionIn());
*
@@ -3135,58 +2139,26 @@ cc.easeQuinticActionInOut = function(){
* //The new usage
* action.easing(cc.easeCircleActionIn());
*/
-cc.EaseCircleActionIn = cc.ActionEase.extend(/** @lends cc.EaseCircleActionIn# */{
+cc.EaseCircleActionIn = cc.ActionEase.extend({
_updateTime: function(time){
return -1 * (Math.sqrt(1 - time * time) - 1);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseCircleActionIn}
- */
clone: function(){
var action = new cc.EaseCircleActionIn();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseCircleActionIn}
- */
reverse: function(){
return new cc.EaseCircleActionIn(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeCircleActionIn());
- *
- * @example
- * //The old usage
- * cc.EaseCircleActionIn.create(action);
- * //The new usage
- * action.easing(cc.easeCircleActionIn());
- *
- * @param action
- * @returns {cc.EaseCircleActionIn}
- */
cc.EaseCircleActionIn.create = function(action){
return new cc.EaseCircleActionIn(action);
};
@@ -3201,8 +2173,8 @@ cc._easeCircleActionIn = {
/**
* Creates the action easing object.
* Reference easeInCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeCircleActionIn
* @returns {Object}
* @example
* //example
@@ -3212,12 +2184,12 @@ cc.easeCircleActionIn = function(){
return cc._easeCircleActionIn;
};
-/**
+/*
* cc.EaseCircleActionOut action.
* Reference easeOutCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseCircleActionOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeCircleActionOut());
*
@@ -3227,59 +2199,27 @@ cc.easeCircleActionIn = function(){
* //The new usage
* action.easing(cc.easeCircleActionOut());
*/
-cc.EaseCircleActionOut = cc.ActionEase.extend(/** @lends cc.EaseCircleActionOut# */{
+cc.EaseCircleActionOut = cc.ActionEase.extend({
_updateTime: function(time){
time = time - 1;
return Math.sqrt(1 - time * time);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseCircleActionOut}
- */
clone: function(){
var action = new cc.EaseCircleActionOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseCircleActionOut}
- */
reverse: function(){
return new cc.EaseCircleActionOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeOutCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeCircleActionOut());
- *
- * @example
- * //The old usage
- * cc.EaseCircleActionOut.create(action);
- * //The new usage
- * action.easing(cc.easeCircleActionOut());
- *
- * @param action
- * @returns {cc.EaseCircleActionOut}
- */
cc.EaseCircleActionOut.create = function(action){
return new cc.EaseCircleActionOut(action);
};
@@ -3294,8 +2234,8 @@ cc._easeCircleActionOut = {
/**
* Creates the action easing object.
* Reference easeOutCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeCircleActionOut
* @returns {Object}
* @exampple
* //example
@@ -3305,12 +2245,12 @@ cc.easeCircleActionOut = function(){
return cc._easeCircleActionOut;
};
-/**
+/*
* cc.EaseCircleActionInOut action.
* Reference easeInOutCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseCircleActionInOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeCircleActionInOut());
*
@@ -3320,7 +2260,7 @@ cc.easeCircleActionOut = function(){
* //The new usage
* action.easing(cc.easeCircleActionInOut());
*/
-cc.EaseCircleActionInOut = cc.ActionEase.extend(/** @lends cc.EaseCircleActionInOut# */{
+cc.EaseCircleActionInOut = cc.ActionEase.extend({
_updateTime: function(time){
time = time * 2;
if (time < 1)
@@ -3329,53 +2269,21 @@ cc.EaseCircleActionInOut = cc.ActionEase.extend(/** @lends cc.EaseCircleActionIn
return 0.5 * (Math.sqrt(1 - time * time) + 1);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseCircleActionInOut}
- */
clone: function(){
var action = new cc.EaseCircleActionInOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseCircleActionInOut}
- */
reverse: function(){
return new cc.EaseCircleActionInOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInOutCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeCircleActionInOut());
- *
- * @example
- * //The old usage
- * cc.EaseCircleActionInOut.create(action);
- * //The new usage
- * action.easing(cc.easeCircleActionInOut());
- *
- * @param action
- * @returns {cc.EaseCircleActionInOut}
- */
cc.EaseCircleActionInOut.create = function(action){
return new cc.EaseCircleActionInOut(action);
};
@@ -3390,8 +2298,8 @@ cc._easeCircleActionInOut = {
/**
* Creates the action easing object.
* Reference easeInOutCirc:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeCircleActionInOut
* @returns {Object}
* @example
* //example
@@ -3401,12 +2309,12 @@ cc.easeCircleActionInOut = function(){
return cc._easeCircleActionInOut;
};
-/**
+/*
* cc.EaseCubicActionIn action.
* Reference easeInCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseCubicActionIn
+ * @extends ActionEase
*
* @deprecated since v3.0
action.easing(cc.easeCubicActionIn());
*
@@ -3416,58 +2324,26 @@ cc.easeCircleActionInOut = function(){
* //The new usage
* action.easing(cc.easeCubicActionIn());
*/
-cc.EaseCubicActionIn = cc.ActionEase.extend(/** @lends cc.EaseCubicActionIn# */{
+cc.EaseCubicActionIn = cc.ActionEase.extend({
_updateTime: function(time){
return time * time * time;
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseCubicActionIn}
- */
clone: function(){
var action = new cc.EaseCubicActionIn();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseCubicActionIn}
- */
reverse: function(){
return new cc.EaseCubicActionIn(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
action.easing(cc.easeCubicActionIn());
- *
- * @example
- * //The old usage
- * cc.EaseCubicActionIn.create(action);
- * //The new usage
- * action.easing(cc.easeCubicActionIn());
- *
- * @param action
- * @returns {cc.EaseCubicActionIn}
- */
cc.EaseCubicActionIn.create = function(action){
return new cc.EaseCubicActionIn(action);
};
@@ -3482,8 +2358,8 @@ cc._easeCubicActionIn = {
/**
* Creates the action easing object.
* Reference easeInCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeCubicActionIn
* @returns {Object}
* @example
* //example
@@ -3493,12 +2369,12 @@ cc.easeCubicActionIn = function(){
return cc._easeCubicActionIn;
};
-/**
+/*
* cc.EaseCubicActionOut action.
* Reference easeOutCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseCubicActionOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeCubicActionOut());
*
@@ -3508,59 +2384,27 @@ cc.easeCubicActionIn = function(){
* //The new usage
* action.easing(cc.easeCubicActionOut());
*/
-cc.EaseCubicActionOut = cc.ActionEase.extend(/** @lends cc.EaseCubicActionOut# */{
+cc.EaseCubicActionOut = cc.ActionEase.extend({
_updateTime: function(time){
time -= 1;
return (time * time * time + 1);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseCubicActionOut}
- */
clone: function(){
var action = new cc.EaseCubicActionOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseCubicActionOut}
- */
reverse: function(){
return new cc.EaseCubicActionOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeOutCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeCubicActionOut());
- *
- * @example
- * //The old usage
- * cc.EaseCubicActionOut.create(action);
- * //The new usage
- * action.easing(cc.easeCubicActionOut());
- *
- * @param action
- * @returns {cc.EaseCubicActionOut}
- */
cc.EaseCubicActionOut.create = function(action){
return new cc.EaseCubicActionOut(action);
};
@@ -3575,8 +2419,8 @@ cc._easeCubicActionOut = {
/**
* Creates the action easing object.
* Reference easeOutCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeCubicActionOut
* @returns {Object}
* @example
* //example
@@ -3586,12 +2430,12 @@ cc.easeCubicActionOut = function(){
return cc._easeCubicActionOut;
};
-/**
+/*
* cc.EaseCubicActionInOut action.
* Reference easeInOutCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @class
- * @extends cc.ActionEase
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @class EaseCubicActionInOut
+ * @extends ActionEase
*
* @deprecated since v3.0
Please use action.easing(cc.easeCubicActionInOut());
*
@@ -3601,7 +2445,7 @@ cc.easeCubicActionOut = function(){
* //The new usage
* action.easing(cc.easeCubicActionInOut());
*/
-cc.EaseCubicActionInOut = cc.ActionEase.extend(/** @lends cc.EaseCubicActionInOut# */{
+cc.EaseCubicActionInOut = cc.ActionEase.extend({
_updateTime: function(time){
time = time*2;
if (time < 1)
@@ -3610,53 +2454,21 @@ cc.EaseCubicActionInOut = cc.ActionEase.extend(/** @lends cc.EaseCubicActionInOu
return 0.5 * (time * time * time + 2);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update: function(dt){
this._inner.update(this._updateTime(dt));
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @returns {cc.EaseCubicActionInOut}
- */
clone: function(){
var action = new cc.EaseCubicActionInOut();
action.initWithAction(this._inner.clone());
return action;
},
- /**
- * Create a action. Opposite with the original motion trajectory.
- * @return {cc.EaseCubicActionInOut}
- */
reverse: function(){
return new cc.EaseCubicActionInOut(this._inner.reverse());
}
});
-/**
- * Creates the action.
- * Reference easeInOutCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @static
- *
- * @deprecated since v3.0
Please use action.easing(cc.easeCubicActionInOut());
- *
- * @example
- * //The old usage
- * cc.EaseCubicActionInOut.create(action);
- * //The new usage
- * action.easing(cc.easeCubicActionInOut());
- *
- * @param action
- * @returns {cc.EaseCubicActionInOut}
- */
cc.EaseCubicActionInOut.create = function(action){
return new cc.EaseCubicActionInOut(action);
};
@@ -3671,8 +2483,8 @@ cc._easeCubicActionInOut = {
/**
* Creates the action easing object.
* Reference easeInOutCubic:
- * {@link http://www.zhihu.com/question/21981571/answer/19925418}
- * @function
+ * http://www.zhihu.com/question/21981571/answer/19925418
+ * @method cc.easeCubicActionInOut
* @returns {Object}
*/
cc.easeCubicActionInOut = function(){
diff --git a/cocos2d/actions/CCActionInstant.js b/cocos2d/actions/CCActionInstant.js
index 821d401679..3e492b911e 100644
--- a/cocos2d/actions/CCActionInstant.js
+++ b/cocos2d/actions/CCActionInstant.js
@@ -25,34 +25,23 @@
****************************************************************************/
/**
- * Instant actions are immediate actions. They don't have a duration like.
- * the CCIntervalAction actions.
- * @class
- * @extends cc.FiniteTimeAction
+ * @module actions
*/
-cc.ActionInstant = cc.FiniteTimeAction.extend(/** @lends cc.ActionInstant# */{
- /**
- * return true if the action has finished.
- * @return {Boolean}
- */
+
+/**
+ * Instant actions are immediate actions. They don't have a duration like the ActionInterval actions.
+ * @class ActionInstant
+ * @extends FiniteTimeAction
+ */
+cc.ActionInstant = cc.FiniteTimeAction.extend({
isDone:function () {
return true;
},
- /**
- * called every frame with it's delta time.
- * DON'T override unless you know what you are doing.
- * @param {Number} dt
- */
step:function (dt) {
this.update(1);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
//nothing
},
@@ -60,60 +49,38 @@ cc.ActionInstant = cc.FiniteTimeAction.extend(/** @lends cc.ActionInstant# */{
/**
* returns a reversed action.
* For example:
- * - The action will be x coordinates of 0 move to 100.
+ * - The action is x coordinates of 0 move to 100.
* - The reversed action will be x of 100 move to 0.
- * - Will be rewritten
- * @returns {cc.Action}
+ * @returns {Action}
*/
reverse:function(){
return this.clone();
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.FiniteTimeAction}
- */
clone:function(){
return new cc.ActionInstant();
}
});
/**
- * Show the node.
- * @class
- * @extends cc.ActionInstant
+ * @module actions
*/
-cc.Show = cc.ActionInstant.extend(/** @lends cc.Show# */{
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
+/*
+ * Show the node.
+ * @class Show
+ * @extends ActionInstant
+ */
+cc.Show = cc.ActionInstant.extend({
+
update:function (dt) {
this.target.visible = true;
},
- /**
- * 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
- * @returns {cc.Hide}
- */
reverse:function () {
return new cc.Hide();
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.FiniteTimeAction}
- */
clone:function(){
return new cc.Show();
}
@@ -121,8 +88,8 @@ cc.Show = cc.ActionInstant.extend(/** @lends cc.Show# */{
/**
* Show the Node.
- * @function
- * @return {cc.Show}
+ * @method cc.show
+ * @return {Show}
* @example
* // example
* var showAction = cc.show();
@@ -131,48 +98,23 @@ cc.show = function () {
return new cc.Show();
};
-/**
- * Show the Node. Please use cc.show instead.
- * @static
- * @deprecated since v3.0
Please use cc.show instead.
- * @return {cc.Show}
- */
cc.Show.create = cc.show;
-/**
+/*
* Hide the node.
- * @class
- * @extends cc.ActionInstant
+ * @class Hide
+ * @extends ActionInstant
*/
-cc.Hide = cc.ActionInstant.extend(/** @lends cc.Hide# */{
+cc.Hide = cc.ActionInstant.extend({
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
this.target.visible = false;
},
- /**
- * 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
- * @returns {cc.Show}
- */
reverse:function () {
return new cc.Show();
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.Hide}
- */
clone:function(){
return new cc.Hide();
}
@@ -180,8 +122,8 @@ cc.Hide = cc.ActionInstant.extend(/** @lends cc.Hide# */{
/**
* Hide the node.
- * @function
- * @return {cc.Hide}
+ * @method cc.hide
+ * @return {Hide}
* @example
* // example
* var hideAction = cc.hide();
@@ -190,47 +132,23 @@ cc.hide = function () {
return new cc.Hide();
};
-/**
- * Hide the node. Please use cc.hide instead.
- * @static
- * @deprecated since v3.0
Please use cc.hide instead.
- * @return {cc.Hide}
- * @example
- * // example
- * var hideAction = cc.hide();
- */
cc.Hide.create = cc.hide;
-/**
+/*
* Toggles the visibility of a node.
- * @class
- * @extends cc.ActionInstant
+ * @class ToggleVisibility
+ * @extends ActionInstant
*/
-cc.ToggleVisibility = cc.ActionInstant.extend(/** @lends cc.ToggleVisibility# */{
+cc.ToggleVisibility = cc.ActionInstant.extend({
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
this.target.visible = !this.target.visible;
},
- /**
- * returns a reversed action.
- * @returns {cc.ToggleVisibility}
- */
reverse:function () {
return new cc.ToggleVisibility();
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.ToggleVisibility}
- */
clone:function(){
return new cc.ToggleVisibility();
}
@@ -238,8 +156,8 @@ cc.ToggleVisibility = cc.ActionInstant.extend(/** @lends cc.ToggleVisibility# */
/**
* Toggles the visibility of a node.
- * @function
- * @return {cc.ToggleVisibility}
+ * @method cc.toggleVisibility
+ * @return {ToggleVisibility}
* @example
* // example
* var toggleVisibilityAction = cc.toggleVisibility();
@@ -248,18 +166,12 @@ cc.toggleVisibility = function () {
return new cc.ToggleVisibility();
};
-/**
- * Toggles the visibility of a node. Please use cc.toggleVisibility instead.
- * @static
- * @deprecated since v3.0
Please use cc.toggleVisibility instead.
- * @return {cc.ToggleVisibility}
- */
cc.ToggleVisibility.create = cc.toggleVisibility;
-/**
+/*
* Delete self in the next frame.
- * @class
- * @extends cc.ActionInstant
+ * @class RemoveSelf
+ * @extends ActionInstant
* @param {Boolean} [isNeedCleanUp=true]
*
* @example
@@ -269,49 +181,25 @@ cc.ToggleVisibility.create = cc.toggleVisibility;
cc.RemoveSelf = cc.ActionInstant.extend({
_isNeedCleanUp: true,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.
- * @param {Boolean} [isNeedCleanUp=true]
- */
ctor:function(isNeedCleanUp){
cc.FiniteTimeAction.prototype.ctor.call(this);
isNeedCleanUp !== undefined && this.init(isNeedCleanUp);
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function(dt){
this.target.removeFromParent(this._isNeedCleanUp);
},
- /**
- * Initialization of the node, please do not call this function by yourself, you should pass the parameters to constructor to initialize it.
- * @param isNeedCleanUp
- * @returns {boolean}
- */
init:function(isNeedCleanUp){
this._isNeedCleanUp = isNeedCleanUp;
return true;
},
- /**
- * returns a reversed action.
- */
reverse:function(){
return new cc.RemoveSelf(this._isNeedCleanUp);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.RemoveSelf}
- */
clone:function(){
return new cc.RemoveSelf(this._isNeedCleanUp);
}
@@ -320,9 +208,9 @@ cc.RemoveSelf = cc.ActionInstant.extend({
/**
* Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.
*
- * @function
+ * @method cc.removeSelf
* @param {Boolean} [isNeedCleanUp=true]
- * @return {cc.RemoveSelf}
+ * @return {RemoveSelf}
*
* @example
* // example
@@ -332,41 +220,27 @@ cc.removeSelf = function(isNeedCleanUp){
return new cc.RemoveSelf(isNeedCleanUp);
};
-/**
- * Please use cc.removeSelf instead.
- * Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.
- *
- * @static
- * @deprecated since v3.0
Please use cc.removeSelf instead.
- * @param {Boolean} [isNeedCleanUp=true]
- * @return {cc.RemoveSelf}
- */
cc.RemoveSelf.create = cc.removeSelf;
-/**
+/*
* Flips the sprite horizontally.
- * @class
- * @extends cc.ActionInstant
+ * @class FlipX
+ * @extends ActionInstant
* @param {Boolean} flip Indicate whether the target should be flipped or not
*
* @example
* var flipXAction = new cc.FlipX(true);
*/
-cc.FlipX = cc.ActionInstant.extend(/** @lends cc.FlipX# */{
+cc.FlipX = cc.ActionInstant.extend({
_flippedX:false,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * Create a FlipX action to flip or unflip the target.
- * @param {Boolean} flip Indicate whether the target should be flipped or not
- */
ctor:function(flip){
cc.FiniteTimeAction.prototype.ctor.call(this);
this._flippedX = false;
flip !== undefined && this.initWithFlipX(flip);
},
- /**
+ /*
* initializes the action with a set flipX.
* @param {Boolean} flip
* @return {Boolean}
@@ -376,29 +250,14 @@ cc.FlipX = cc.ActionInstant.extend(/** @lends cc.FlipX# */{
return true;
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
this.target.flippedX = this._flippedX;
},
- /**
- * returns a reversed action.
- * @return {cc.FlipX}
- */
reverse:function () {
return new cc.FlipX(!this._flippedX);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.FiniteTimeAction}
- */
clone:function(){
var action = new cc.FlipX();
action.initWithFlipX(this._flippedX);
@@ -409,9 +268,9 @@ cc.FlipX = cc.ActionInstant.extend(/** @lends cc.FlipX# */{
/**
* Create a FlipX action to flip or unflip the target.
*
- * @function
+ * @method cc.flipX
* @param {Boolean} flip Indicate whether the target should be flipped or not
- * @return {cc.FlipX}
+ * @return {FlipX}
* @example
* var flipXAction = cc.flipX(true);
*/
@@ -419,34 +278,19 @@ cc.flipX = function (flip) {
return new cc.FlipX(flip);
};
-/**
- * Plese use cc.flipX instead.
- * Create a FlipX action to flip or unflip the target
- *
- * @static
- * @deprecated since v3.0
Plese use cc.flipX instead.
- * @param {Boolean} flip Indicate whether the target should be flipped or not
- * @return {cc.FlipX}
- */
cc.FlipX.create = cc.flipX;
-/**
+/*
* Flips the sprite vertically
- * @class
- * @extends cc.ActionInstant
+ * @class FlipY
+ * @extends ActionInstant
* @param {Boolean} flip
* @example
* var flipYAction = new cc.FlipY(true);
*/
-cc.FlipY = cc.ActionInstant.extend(/** @lends cc.FlipY# */{
+cc.FlipY = cc.ActionInstant.extend({
_flippedY:false,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * Create a FlipY action to flip or unflip the target.
- *
- * @param {Boolean} flip
- */
ctor: function(flip){
cc.FiniteTimeAction.prototype.ctor.call(this);
this._flippedY = false;
@@ -454,7 +298,7 @@ cc.FlipY = cc.ActionInstant.extend(/** @lends cc.FlipY# */{
flip !== undefined && this.initWithFlipY(flip);
},
- /**
+ /*
* initializes the action with a set flipY.
* @param {Boolean} flip
* @return {Boolean}
@@ -464,29 +308,14 @@ cc.FlipY = cc.ActionInstant.extend(/** @lends cc.FlipY# */{
return true;
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
this.target.flippedY = this._flippedY;
},
- /**
- * returns a reversed action.
- * @return {cc.FlipY}
- */
reverse:function () {
return new cc.FlipY(!this._flippedY);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.FlipY}
- */
clone:function(){
var action = new cc.FlipY();
action.initWithFlipY(this._flippedY);
@@ -497,9 +326,9 @@ cc.FlipY = cc.ActionInstant.extend(/** @lends cc.FlipY# */{
/**
* Create a FlipY action to flip or unflip the target.
*
- * @function
+ * @method cc.flipY
* @param {Boolean} flip
- * @return {cc.FlipY}
+ * @return {FlipY}
* @example
* var flipYAction = cc.flipY(true);
*/
@@ -507,37 +336,22 @@ cc.flipY = function (flip) {
return new cc.FlipY(flip);
};
-/**
- * Please use cc.flipY instead
- * Create a FlipY action to flip or unflip the target
- *
- * @static
- * @deprecated since v3.0
Please use cc.flipY instead.
- * @param {Boolean} flip
- * @return {cc.FlipY}
- */
cc.FlipY.create = cc.flipY;
-/**
+/*
* Places the node in a certain position
- * @class
- * @extends cc.ActionInstant
- * @param {cc.Vec2|Number} pos
+ * @class Place
+ * @extends ActionInstant
+ * @param {Vec2|Number} pos
* @param {Number} [y]
* @example
* var placeAction = new cc.Place(cc.p(200, 200));
* var placeAction = new cc.Place(200, 200);
*/
-cc.Place = cc.ActionInstant.extend(/** @lends cc.Place# */{
+cc.Place = cc.ActionInstant.extend({
_x: 0,
_y: 0,
- /**
- * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- * Creates a Place action with a position.
- * @param {cc.Vec2|Number} pos
- * @param {Number} [y]
- */
ctor:function(pos, y){
cc.FiniteTimeAction.prototype.ctor.call(this);
this._x = 0;
@@ -552,7 +366,7 @@ cc.Place = cc.ActionInstant.extend(/** @lends cc.Place# */{
}
},
- /**
+ /*
* Initializes a Place action with a position
* @param {number} x
* @param {number} y
@@ -564,21 +378,10 @@ cc.Place = cc.ActionInstant.extend(/** @lends cc.Place# */{
return true;
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
this.target.setPosition(this._x, this._y);
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.Place}
- */
clone:function(){
var action = new cc.Place();
action.initWithPosition(this._x, this._y);
@@ -588,10 +391,10 @@ cc.Place = cc.ActionInstant.extend(/** @lends cc.Place# */{
/**
* Creates a Place action with a position.
- * @function
- * @param {cc.Vec2|Number} pos
+ * @method cc.place
+ * @param {Vec2|Number} pos
* @param {Number} [y]
- * @return {cc.Place}
+ * @return {Place}
* @example
* // example
* var placeAction = cc.place(cc.p(200, 200));
@@ -601,22 +404,13 @@ cc.place = function (pos, y) {
return new cc.Place(pos, y);
};
-/**
- * Please use cc.place instead.
- * Creates a Place action with a position.
- * @static
- * @deprecated since v3.0
Please use cc.place instead.
- * @param {cc.Vec2|Number} pos
- * @param {Number} [y]
- * @return {cc.Place}
- */
cc.Place.create = cc.place;
-/**
+/*
* Calls a 'callback'.
- * @class
- * @extends cc.ActionInstant
+ * @class CallFunc
+ * @extends ActionInstant
* @param {function} selector
* @param {object|null} [selectorTarget]
* @param {*|null} [data] data for function, it accepts all data types.
@@ -628,12 +422,12 @@ cc.Place.create = cc.place;
* // CallFunc with data
* var finish = new cc.CallFunc(this.removeFromParentAndCleanup, this, true);
*/
-cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
+cc.CallFunc = cc.ActionInstant.extend({
_selectorTarget:null,
_function:null,
_data:null,
- /**
+ /*
* Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
* Creates a CallFunc action with the callback.
* @param {function} selector
@@ -646,7 +440,7 @@ cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
this.initWithFunction(selector, selectorTarget, data);
},
- /**
+ /*
* Initializes the action with a function or function and its target
* @param {function} selector
* @param {object|Null} selectorTarget
@@ -666,7 +460,7 @@ cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
return true;
},
- /**
+ /*
* execute the function.
*/
execute:function () {
@@ -675,16 +469,11 @@ cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
}
},
- /**
- * Called once per frame. Time is the number of seconds of a frame interval.
- *
- * @param {Number} dt
- */
update:function (dt) {
this.execute();
},
- /**
+ /*
* Get selectorTarget.
* @return {object}
*/
@@ -692,7 +481,7 @@ cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
return this._selectorTarget;
},
- /**
+ /*
* Set selectorTarget.
* @param {object} sel
*/
@@ -704,12 +493,6 @@ cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
}
},
- /**
- * to copy object with deep copy.
- * returns a clone of action.
- *
- * @return {cc.CallFunc}
- */
clone:function(){
var action = new cc.CallFunc();
action.initWithFunction(this._function, this._selectorTarget, this._data);
@@ -719,11 +502,11 @@ cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
/**
* Creates the action with the callback
- * @function
+ * @method cc.callFunc
* @param {function} selector
* @param {object|null} [selectorTarget]
* @param {*|null} [data] data for function, it accepts all data types.
- * @return {cc.CallFunc}
+ * @return {CallFunc}
* @example
* // example
* // CallFunc without data
@@ -736,14 +519,4 @@ cc.callFunc = function (selector, selectorTarget, data) {
return new cc.CallFunc(selector, selectorTarget, data);
};
-/**
- * Please use cc.callFunc instead.
- * Creates the action with the callback.
- * @static
- * @deprecated since v3.0
Please use cc.callFunc instead.
- * @param {function} selector
- * @param {object|null} [selectorTarget]
- * @param {*|null} [data] data for function, it accepts all data types.
- * @return {cc.CallFunc}
- */
cc.CallFunc.create = cc.callFunc;
diff --git a/cocos2d/actions/CCActionInterval.js b/cocos2d/actions/CCActionInterval.js
index 420c89fad6..9cde873298 100644
--- a/cocos2d/actions/CCActionInterval.js
+++ b/cocos2d/actions/CCActionInterval.js
@@ -24,6 +24,10 @@
THE SOFTWARE.
****************************************************************************/
+/**
+ * @module actions
+ */
+
/**
*
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
@@ -37,13 +41,11 @@
*
For example, you can simulate a Ping Pong effect running the action normally and
* then running it again in Reverse mode.
- * Moves a CCNode object x,y pixels by modifying it's position attribute.
- * x and y are relative to the position of the object.
- * Several CCMoveBy actions can be concurrently called, and the resulting
- * movement will be the sum of individual movements.
+ * Moves a Node object x,y pixels by modifying its position property.
+ * x and y are relative to the position of the object.
+ * Several MoveBy actions can be concurrently called, and the resulting
+ * movement will be the sum of individual movements.
*
* Executes an action in reverse order, from time=duration to time=0
* @warning Use this action carefully. This action is not sequenceable.
* Use it as the default "reversed" method of your own actions, but using it outside the "reversed"
* scope is not recommended.
*
- * Overrides the target of an action so that it always runs on the target
- * specified at action creation rather than the one specified by runAction.
+ * Overrides the target of an action so that it always runs on the target
+ * specified at action creation rather than the one specified by runAction.
*