Skip to content

Commit 6793829

Browse files
committed
Merge branch 'Iss3943_ActionAPI' of https://github.com/dingpinglv/cocos2d-html5 into develop-repeat
2 parents 11dbe46 + 37f8d84 commit 6793829

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

cocos2d/actions/CCActionEase.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,11 @@ cc.easeElasticOut = function (period) {
850850
_period: period,
851851
easing: function (dt) {
852852
return (dt === 0 || dt === 1) ? dt : Math.pow(2, -10 * dt) * Math.sin((dt - (this._period / 4)) * Math.PI * 2 / this._period) + 1;
853-
}};
853+
},
854+
reverse:function(){
855+
return cc.easeElasticIn(this._period);
856+
}
857+
};
854858
}
855859
return cc._easeElasticOutObj;
856860
};

cocos2d/actions/CCActionInterval.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,10 @@ cc.Repeat = cc.ActionInterval.extend(/** @lends cc.Repeat# */{
491491
if (this.initWithDuration(duration)) {
492492
this._times = times;
493493
this._innerAction = action;
494-
if (action instanceof cc.ActionInstant)
494+
if (action instanceof cc.ActionInstant){
495+
this._actionInstant = true;
495496
this._times -= 1;
497+
}
496498
this._total = 0;
497499
return true;
498500
}
@@ -551,9 +553,9 @@ cc.Repeat = cc.ActionInterval.extend(/** @lends cc.Repeat# */{
551553
if (time >= 1.0 && this._total < locTimes)
552554
this._total++;
553555

554-
// don't set a instantaction back or update it, it has no use because it has no duration
555-
if (this._actionInstant) {
556-
if (this._total == locTimes) {
556+
// don't set a instant action back or update it, it has no use because it has no duration
557+
if (!this._actionInstant) {
558+
if (this._total === locTimes) {
557559
locInnerAction.update(1);
558560
locInnerAction.stop();
559561
} else {
@@ -1003,7 +1005,7 @@ cc.RotateBy = cc.ActionInterval.extend(/** @lends cc.RotateBy# */{
10031005

10041006
/**
10051007
* @constructor
1006-
* @param {Number} duration druation in seconds
1008+
* @param {Number} duration duration in seconds
10071009
* @param {Number} deltaAngleX deltaAngleX in degrees
10081010
* @param {Number} [deltaAngleY] deltaAngleY in degrees
10091011
* @example
@@ -1061,7 +1063,7 @@ cc.RotateBy = cc.ActionInterval.extend(/** @lends cc.RotateBy# */{
10611063
},
10621064

10631065
/**
1064-
* @return {cc.ActionInterval}
1066+
* @return {cc.RotateBy}
10651067
*/
10661068
reverse:function () {
10671069
var action = cc.RotateBy.create(this._duration, -this._angleX, -this._angleY);
@@ -1071,7 +1073,7 @@ cc.RotateBy = cc.ActionInterval.extend(/** @lends cc.RotateBy# */{
10711073
});
10721074

10731075
/**
1074-
* @param {Number} duration druation in seconds
1076+
* @param {Number} duration duration in seconds
10751077
* @param {Number} deltaAngleX deltaAngleX in degrees
10761078
* @param {Number} [deltaAngleY] deltaAngleY in degrees
10771079
* @return {cc.RotateBy}
@@ -1201,7 +1203,7 @@ cc.MoveBy = cc.ActionInterval.extend(/** @lends cc.MoveBy# */{
12011203

12021204
/**
12031205
* @param {Number} duration duration in seconds
1204-
* @param {cc.Point|Number} deltaPosition
1206+
* @param {cc.Point|Number} deltaPos
12051207
* @param {Number} deltaY
12061208
* @return {cc.MoveBy}
12071209
* @example

cocos2d/core/CCDirectorWebGL.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ _tmp.DirectorWebGL = function () {
152152

153153
_p._createStatsLabel = function () {
154154
var _t = this;
155-
if (!cc.LabelAtlas)
156-
return _t._createStatsLabelForCanvas();
155+
if (!cc.LabelAtlas){
156+
_t._createStatsLabelForCanvas();
157+
return
158+
}
157159

158160
if ((cc.Director._fpsImageLoaded == null) || (cc.Director._fpsImageLoaded == false))
159161
return;

0 commit comments

Comments
 (0)