Merge pull request #308 from minggo/master

fix some comments
This commit is contained in:
pandamicro
2016-02-02 11:29:31 +08:00
15 changed files with 84 additions and 76 deletions
+6 -2
View File
@@ -344,6 +344,10 @@ cc.Speed = cc.Action.extend({
}
});
/**
* @module cc
*/
/**
* Creates the speed action which changes the speed of an action, making it take longer (speed > 1)
* or less (speed < 1) time. <br/>
@@ -354,7 +358,7 @@ cc.Speed = cc.Action.extend({
* @method speed
* @param {ActionInterval} action
* @param {Number} speed
* @return {Speed}
* @return {Action}
*/
cc.speed = function (action, speed) {
return new cc.Speed(action, speed);
@@ -544,7 +548,7 @@ cc.Follow = cc.Action.extend({
* @method follow
* @param {Node} followedNode
* @param {Rect} rect
* @return {Follow|Null} returns the cc.Follow object on success
* @return {Action|Null} returns the cc.Follow object on success
* @example
* // example
* // creates the action with a set boundary
+21 -21
View File
@@ -36,7 +36,7 @@
* @module cc
*/
/**
/*
* Returns the Cardinal Spline position for a given set of control points, tension and time. <br />
* CatmullRom Spline formula. <br />
* 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
@@ -69,7 +69,7 @@ cc.cardinalSplineAt = function (p0, p1, p2, p3, tension, t) {
return cc.p(x, y);
};
/**
/*
* returns a new copy of the array reversed.
* @method reverseControlPoints
* @param {Array} controlPoints
@@ -84,7 +84,7 @@ cc.reverseControlPoints = function (controlPoints) {
};
/**
/*
* returns a new clone of the controlPoints
* @method cloneControlPoints
* @param {Array} controlPoints
@@ -99,7 +99,7 @@ cc.cloneControlPoints = function (controlPoints) {
cc.copyControlPoints = cc.cloneControlPoints;
/**
/*
* returns a point from the array
* @method getControlPointAt
* @param {Array} controlPoints
@@ -111,7 +111,7 @@ cc.getControlPointAt = function (controlPoints, pos) {
return controlPoints[p];
};
/**
/*
* reverse the current control point array inline, without generating a new one <br />
* @method reverseControlPointsInline
* @param {Array} controlPoints
@@ -127,7 +127,7 @@ cc.reverseControlPointsInline = function (controlPoints) {
};
/**
/*
* Cardinal Spline path. http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline
* Absolute coordinates.
*
@@ -157,7 +157,7 @@ cc.CardinalSplineTo = cc.ActionInterval.extend({
tension !== undefined && this.initWithDuration(duration, points, tension);
},
/**
/*
* initializes the action with a duration and an array of points
* @method initWithDuration
* @param {Number} duration
@@ -238,7 +238,7 @@ cc.CardinalSplineTo = cc.ActionInterval.extend({
return cc.cardinalSplineTo(this._duration, reversePoints, this._tension);
},
/**
/*
* update position of target
* @method updatePosition
* @param {Vec2} newPos
@@ -248,7 +248,7 @@ cc.CardinalSplineTo = cc.ActionInterval.extend({
this._previousPosition = newPos;
},
/**
/*
* Points getter
* @method getPoints
* @return {Array}
@@ -257,7 +257,7 @@ cc.CardinalSplineTo = cc.ActionInterval.extend({
return this._points;
},
/**
/*
* Points setter
* @method setPoints
* @param {Array} points
@@ -274,7 +274,7 @@ cc.CardinalSplineTo = cc.ActionInterval.extend({
* @param {Number} duration
* @param {Array} points array of control points
* @param {Number} tension
* @return {CardinalSplineTo}
* @return {ActionInterval}
*
* @example
* //create a cc.CardinalSplineTo
@@ -286,7 +286,7 @@ cc.cardinalSplineTo = function (duration, points, tension) {
cc.CardinalSplineTo.create = cc.cardinalSplineTo;
/**
/*
* Cardinal Spline path. http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline
* Relative coordinates.
*
@@ -353,7 +353,7 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend({
return cc.cardinalSplineBy(this._duration, reverseArray, this._tension);
},
/**
/*
* update position of target
* @method updatePosition
* @param {Vec2} newPos
@@ -367,7 +367,7 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend({
this.target.setPosition(posX, posY);
},
/**
/*
* returns a new clone of the action
* @method clone
* @returns {CardinalSplineBy}
@@ -387,14 +387,14 @@ cc.CardinalSplineBy = cc.CardinalSplineTo.extend({
* @param {Array} points
* @param {Number} tension
*
* @return {CardinalSplineBy}
* @return {ActionInterval}
*/
cc.cardinalSplineBy = function (duration, points, tension) {
return new cc.CardinalSplineBy(duration, points, tension);
};
cc.CardinalSplineBy.create = cc.cardinalSplineBy;
/**
/*
* An action that moves the target with a CatmullRom curve to a destination point.<br/>
* A Catmull Rom is a Cardinal Spline with a tension of 0.5. <br/>
* http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline
@@ -415,7 +415,7 @@ cc.CatmullRomTo = cc.CardinalSplineTo.extend({
points && this.initWithDuration(dt, points);
},
/**
/*
* Initializes the action with a duration and an array of points
* @method initWithDuration
* @param {Number} dt
@@ -438,7 +438,7 @@ cc.CatmullRomTo = cc.CardinalSplineTo.extend({
* @method catmullRomTo
* @param {Number} dt
* @param {Array} points
* @return {CatmullRomTo}
* @return {ActionInterval}
*
* @example
* var action1 = cc.catmullRomTo(3, array);
@@ -448,7 +448,7 @@ cc.catmullRomTo = function (dt, points) {
};
cc.CatmullRomTo.create = cc.catmullRomTo;
/**
/*
* An action that moves the target with a CatmullRom curve by a certain distance. <br/>
* A Catmull Rom is a Cardinal Spline with a tension of 0.5.<br/>
* http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline
@@ -470,7 +470,7 @@ cc.CatmullRomBy = cc.CardinalSplineBy.extend({
points && this.initWithDuration(dt, points);
},
/**
/*
* initializes the action with a duration and an array of points
*
* @method initWithDuration
@@ -493,7 +493,7 @@ cc.CatmullRomBy = cc.CardinalSplineBy.extend({
* @method catmullRomBy
* @param {Number} dt
* @param {Array} points
* @return {CatmullRomBy}
* @return {ActionInterval}
* @example
* var action1 = cc.catmullRomBy(3, array);
*/
+8 -8
View File
@@ -89,7 +89,7 @@ cc.Show = cc.ActionInstant.extend({
/**
* Show the Node.
* @method show
* @return {Show}
* @return {ActionInstant}
* @example
* // example
* var showAction = cc.show();
@@ -123,7 +123,7 @@ cc.Hide = cc.ActionInstant.extend({
/**
* Hide the node.
* @method hide
* @return {Hide}
* @return {ActionInstant}
* @example
* // example
* var hideAction = cc.hide();
@@ -157,7 +157,7 @@ cc.ToggleVisibility = cc.ActionInstant.extend({
/**
* Toggles the visibility of a node.
* @method toggleVisibility
* @return {ToggleVisibility}
* @return {ActionInstant}
* @example
* // example
* var toggleVisibilityAction = cc.toggleVisibility();
@@ -210,7 +210,7 @@ cc.RemoveSelf = cc.ActionInstant.extend({
*
* @method removeSelf
* @param {Boolean} [isNeedCleanUp=true]
* @return {RemoveSelf}
* @return {ActionInstant}
*
* @example
* // example
@@ -270,7 +270,7 @@ cc.FlipX = cc.ActionInstant.extend({
*
* @method flipX
* @param {Boolean} flip Indicate whether the target should be flipped or not
* @return {FlipX}
* @return {ActionInstant}
* @example
* var flipXAction = cc.flipX(true);
*/
@@ -328,7 +328,7 @@ cc.FlipY = cc.ActionInstant.extend({
*
* @method flipY
* @param {Boolean} flip
* @return {FlipY}
* @return {ActionInstant}
* @example
* var flipYAction = cc.flipY(true);
*/
@@ -394,7 +394,7 @@ cc.Place = cc.ActionInstant.extend({
* @method place
* @param {Vec2|Number} pos
* @param {Number} [y]
* @return {Place}
* @return {ActionInstant}
* @example
* // example
* var placeAction = cc.place(cc.p(200, 200));
@@ -506,7 +506,7 @@ cc.CallFunc = cc.ActionInstant.extend({
* @param {function} selector
* @param {object|null} [selectorTarget]
* @param {*|null} [data] data for function, it accepts all data types.
* @return {CallFunc}
* @return {ActionInstant}
* @example
* // example
* // CallFunc without data
+25 -25
View File
@@ -420,7 +420,7 @@ cc.Sequence = cc.ActionInterval.extend({
* The created action will run actions sequentially, one after another.
* @method sequence
* @param {Array|FiniteTimeAction} tempArray
* @return {Sequence}
* @return {ActionInterval}
* @example
* // example
* // create sequence with actions
@@ -598,7 +598,7 @@ cc.Repeat = cc.ActionInterval.extend({
* @method repeat
* @param {FiniteTimeAction} action
* @param {Number} times
* @return {Repeat}
* @return {ActionInterval}
* @example
* // example
* var rep = cc.repeat(cc.sequence(jump2, jump1), 5);
@@ -701,7 +701,7 @@ cc.RepeatForever = cc.ActionInterval.extend({
* Create a acton which repeat forever
* @method repeatForever
* @param {FiniteTimeAction} action
* @return {RepeatForever}
* @return {ActionInterval}
* @example
* // example
* var repeat = cc.repeatForever(cc.rotateBy(1.0, 360));
@@ -932,7 +932,7 @@ cc.RotateTo = cc.ActionInterval.extend({
* @param {Number} duration duration in seconds
* @param {Number} deltaAngleX deltaAngleX in degrees.
* @param {Number} [deltaAngleY] deltaAngleY in degrees.
* @return {RotateTo}
* @return {ActionInterval}
* @example
* // example
* var rotateTo = cc.rotateTo(2, 61.0);
@@ -1019,7 +1019,7 @@ cc.RotateBy = cc.ActionInterval.extend({
* @param {Number} duration duration in seconds
* @param {Number} deltaAngleX deltaAngleX in degrees
* @param {Number} [deltaAngleY] deltaAngleY in degrees
* @return {RotateBy}
* @return {ActionInterval}
* @example
* // example
* var actionBy = cc.rotateBy(2, 360);
@@ -1140,7 +1140,7 @@ cc.MoveBy = cc.ActionInterval.extend({
* @param {Number} duration duration in seconds
* @param {Vec2|Number} deltaPos
* @param {Number} deltaY
* @return {MoveBy}
* @return {ActionInterval}
* @example
* // example
* var actionTo = cc.moveBy(2, cc.p(windowSize.width - 40, windowSize.height - 40));
@@ -1217,7 +1217,7 @@ cc.MoveTo = cc.MoveBy.extend({
* @param {Number} duration duration in seconds
* @param {Vec2} position
* @param {Number} y
* @return {MoveBy}
* @return {ActionInterval}
* @example
* // example
* var actionBy = cc.moveTo(2, cc.p(80, 80));
@@ -1310,7 +1310,7 @@ cc.SkewTo = cc.ActionInterval.extend({
* @param {Number} t time in seconds
* @param {Number} sx
* @param {Number} sy
* @return {SkewTo}
* @return {ActionInterval}
* @example
* // example
* var actionTo = cc.skewTo(2, 37.2, -37.2);
@@ -1384,7 +1384,7 @@ cc.SkewBy = cc.SkewTo.extend({
* @param {Number} t time in seconds
* @param {Number} sx sx skew in degrees for X axis
* @param {Number} sy sy skew in degrees for Y axis
* @return {SkewBy}
* @return {ActionInterval}
* @example
* // example
* var actionBy = cc.skewBy(2, 0, -90);
@@ -1514,7 +1514,7 @@ cc.JumpBy = cc.ActionInterval.extend({
* @param {Number} [y]
* @param {Number} height
* @param {Number} jumps
* @return {JumpBy}
* @return {ActionInterval}
* @example
* // example
* var actionBy = cc.jumpBy(2, cc.p(300, 0), 50, 4);
@@ -1596,7 +1596,7 @@ cc.JumpTo = cc.JumpBy.extend({
* @param {Number} [y]
* @param {Number} height
* @param {Number} jumps
* @return {JumpTo}
* @return {ActionInterval}
* @example
* // example
* var actionTo = cc.jumpTo(2, cc.p(300, 300), 50, 4);
@@ -1739,7 +1739,7 @@ cc.BezierBy = cc.ActionInterval.extend({
* @method bezierBy
* @param {Number} t time in seconds
* @param {Array} c Array of points
* @return {BezierBy}
* @return {ActionInterval}
* @example
* // example
* var bezier = [cc.p(0, windowSize.height / 2), cc.p(300, -windowSize.height / 2), cc.p(300, 100)];
@@ -1806,7 +1806,7 @@ cc.BezierTo = cc.BezierBy.extend({
* @method bezierTo
* @param {Number} t
* @param {Array} c array of points
* @return {BezierTo}
* @return {ActionInterval}
* @example
* // example
* var bezier = [cc.p(0, windowSize.height / 2), cc.p(300, -windowSize.height / 2), cc.p(300, 100)];
@@ -1892,7 +1892,7 @@ cc.ScaleTo = cc.ActionInterval.extend({
* @param {Number} duration
* @param {Number} sx scale parameter in X
* @param {Number} [sy] scale parameter in Y, if Null equal to sx
* @return {ScaleTo}
* @return {ActionInterval}
* @example
* // example
* // It scales to 0.5 in both X and Y.
@@ -1940,7 +1940,7 @@ cc.ScaleBy = cc.ScaleTo.extend({
* @param {Number} duration duration in seconds
* @param {Number} sx sx scale parameter in X
* @param {Number|Null} [sy=] sy scale parameter in Y, if Null equal to sx
* @return {ScaleBy}
* @return {ActionInterval}
* @example
* // example without sy, it scales by 2 both in X and Y
* var actionBy = cc.scaleBy(2, 2);
@@ -2022,7 +2022,7 @@ cc.Blink = cc.ActionInterval.extend({
* @method blink
* @param {Number} duration duration in seconds
* @param {Number} blinks blinks in times
* @return {Blink}
* @return {ActionInterval}
* @example
* // example
* var action = cc.blink(2, 10);
@@ -2088,7 +2088,7 @@ cc.FadeTo = cc.ActionInterval.extend({
* @method fadeTo
* @param {Number} duration
* @param {Number} opacity 0-255, 0 is transparent
* @return {FadeTo}
* @return {ActionInterval}
* @example
* // example
* var action = cc.fadeTo(1.0, 0);
@@ -2140,7 +2140,7 @@ cc.FadeIn = cc.FadeTo.extend({
* Fades In an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 0 to 255.
* @method fadeIn
* @param {Number} duration duration in seconds
* @return {FadeIn}
* @return {ActionInterval}
* @example
* //example
* var action = cc.fadeIn(1.0);
@@ -2187,7 +2187,7 @@ cc.FadeOut = cc.FadeTo.extend({
* Fades Out an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 255 to 0.
* @method fadeOut
* @param {Number} d duration in seconds
* @return {FadeOut}
* @return {ActionInterval}
* @example
* // example
* var action = cc.fadeOut(1.0);
@@ -2271,7 +2271,7 @@ cc.TintTo = cc.ActionInterval.extend({
* @param {Number} red 0-255
* @param {Number} green 0-255
* @param {Number} blue 0-255
* @return {TintTo}
* @return {ActionInterval}
* @example
* // example
* var action = cc.tintTo(2, 255, 0, 255);
@@ -2365,7 +2365,7 @@ cc.TintBy = cc.ActionInterval.extend({
* @param {Number} deltaRed
* @param {Number} deltaGreen
* @param {Number} deltaBlue
* @return {TintBy}
* @return {ActionInterval}
* @example
* // example
* var action = cc.tintBy(2, -127, -255, -127);
@@ -2401,7 +2401,7 @@ cc.DelayTime = cc.ActionInterval.extend({
* Delays the action a certain amount of seconds
* @method delayTime
* @param {Number} d duration in seconds
* @return {DelayTime}
* @return {ActionInterval}
* @example
* // example
* var delay = cc.delayTime(1);
@@ -2484,7 +2484,7 @@ cc.ReverseTime = cc.ActionInterval.extend({
* Executes an action in reverse order, from time=duration to time=0.
* @method reverseTime
* @param {FiniteTimeAction} action
* @return {ReverseTime}
* @return {ActionInterval}
* @example
* // example
* var reverse = cc.reverseTime(this);
@@ -2653,7 +2653,7 @@ cc.Animate = cc.ActionInterval.extend({
* create the animate with animation
* @method animate
* @param {SpriteFrameAnimation} animation
* @return {Animate}
* @return {ActionInterval}
* @example
* // example
* // create the animation with animation
@@ -2742,7 +2742,7 @@ cc.TargetedAction = cc.ActionInterval.extend({
* @method targetedAction
* @param {Node} target
* @param {FiniteTimeAction} action
* @return {TargetedAction}
* @return {ActionInterval}
*/
cc.targetedAction = function (target, action) {
return new cc.TargetedAction(target, action);
+1 -1
View File
@@ -130,7 +130,7 @@ var Animation = cc.Class({
/**
* Whether the animation should auto play the default clip when start game.
* @property playOnLoad
* @type {bool}
* @type {Boolean}
* @default true
*/
playOnLoad: {
+1 -1
View File
@@ -160,7 +160,7 @@ var Button = cc.Class({
/**
* Color transition duration
* @property {float} duration
* @property {Number} duration
*/
duration: {
default: 0.1,
+1 -1
View File
@@ -92,7 +92,7 @@ var Canvas = cc.Class({
/**
* !#zh: 是否优先将设计分辨率高度撑满视图高度
*
* @property {Boolean} fitWidth
* @property {Boolean} fitHeight
* @default false
*/
fitHeight: {
+1 -1
View File
@@ -177,7 +177,7 @@ var ProgressBar = cc.Class({
/**
* The current progress of the bar sprite. The valid value is between 0-1.
*@property {Float} progress
*@property {Number} progress
*/
progress: {
default: 1,
+1 -1
View File
@@ -104,7 +104,7 @@ var Scrollbar = cc.Class({
/**
* The time to hide scrollbar when scroll finished.
* Note: This value is only useful when enableAutoHide is true.
*@property {Float} autoHideTime
*@property {Number} autoHideTime
*/
autoHideTime: {
default: 1.0,
+4 -4
View File
@@ -122,7 +122,7 @@ var ScrollView = cc.Class({
/**
* It determines how quickly the content stop moving. A value of 1 will stop the movement immediately.
* A value of 0 will never stop the movement until it reaches to the boundary of scrollview.
*@property {Float} brake
*@property {Number} brake
*/
brake: {
default: 0.5,
@@ -142,7 +142,7 @@ var ScrollView = cc.Class({
/**
* The elapse time of bouncing back. A value of 0 will bounce back immediately.
*@property {Float} bounceDuration
*@property {Number} bounceDuration
*/
bounceDuration: {
default: 1,
@@ -374,7 +374,7 @@ var ScrollView = cc.Class({
/**
* Scroll the content to the percent position of ScrollView in any direction.
* @method scrollTo
* @param {Point} anchor - A point which will be clamp between cc.p(0,0) and cc.p(1,1).
* @param {Vec2} anchor - A point which will be clamp between cc.p(0,0) and cc.p(1,1).
* @param {Number} [timeInSecond=0] - Scroll time in second, if you don't pass timeInSecond,
* the content will jump to the percent position of ScrollView immediately.
* @param {Boolean} [attenuated=true] - Whether the scroll acceleration attenuated, default is true.
@@ -418,7 +418,7 @@ var ScrollView = cc.Class({
/**
* Modify the content position.
* @method setContentPosition
* @param {Point} position - The position in content's parent space.
* @param {Vec2} position - The position in content's parent space.
*/
setContentPosition: function(position) {
if (cc.pFuzzyEqual(position, this.getContentPosition(), EPSILON)) {
+1 -1
View File
@@ -178,7 +178,7 @@ var Widget = cc.Class({
/**
* !#zh: 是否水平拉伸,当同时启用左右对齐时,将会水平拉伸,此时宽度设置无效(只读)
*
* @property isStretchHeight
* @property isStretchWidth
* @type {Boolean}
* @default false
* @readOnly
+2 -2
View File
@@ -95,7 +95,7 @@ var _doSendEvent = function (owner, event) {
* @class EventTarget
*/
var EventTarget = function () {
/**
/*
* @property _capturingListeners
* @type {EventListeners}
* @default null
@@ -103,7 +103,7 @@ var EventTarget = function () {
*/
this._capturingListeners = null;
/**
/*
* @property _bubblingListeners
* @type {EventListeners}
* @default null
+5 -1
View File
@@ -337,10 +337,14 @@ if (CC_EDITOR) {
*/
prototype._deserialize = null;
/**
* @module cc
*/
/**
* Checks whether the object is non-nil and not yet destroyed
* @method isValid
* @param {Object|any} value
* @param {any} value
* @return {Boolean} whether is valid
*/
cc.isValid = function (value) {
+1 -1
View File
@@ -496,7 +496,7 @@ var _Deserializer = (function () {
* 也不会将 uuid 保存到 result 对象中。
*
* @method deserialize
* @param {(String|Object)} data - the serialized cc.Asset json string or json object.
* @param {String|Object} data - the serialized cc.Asset json string or json object.
* @param {deserialize.Details} [result] - additional loading result
* @param {Object} [options]
* @return {object} the main data(asset)
+6 -6
View File
@@ -87,7 +87,7 @@ cc.pMult = function (point, floatVar) {
* @method pMidpoint
* @param {Vec2} v1
* @param {Vec2} v2
* @return {pMult}
* @return {Vec2}
*/
cc.pMidpoint = function (v1, v2) {
return cc.pMult(cc.pAdd(v1, v2), 0.5);
@@ -129,7 +129,7 @@ cc.pPerp = function (point) {
* Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) smaller than 0
* @method pRPerp
* @param {Vec2} point
* @return Vec2}
* @return {Vec2}
*/
cc.pRPerp = function (point) {
return cc.p(point.y, -point.x);
@@ -140,7 +140,7 @@ cc.pRPerp = function (point) {
* @method pProject
* @param {Vec2} v1
* @param {Vec2} v2
* @return {pMult}
* @return {Vec2}
*/
cc.pProject = function (v1, v2) {
return cc.pMult(v2, cc.pDot(v1, v2) / cc.pDot(v2, v2));
@@ -271,7 +271,7 @@ cc.clamp01 = function (value) {
/**
* Clamp a point between from and to.
* @method pClamp
* @param {Point} p
* @param {Vec2} p
* @param {Number} min_inclusive
* @param {Number} max_inclusive
* @return {Vec2}
@@ -314,7 +314,7 @@ cc.pCompOp = function (p, opFunc) {
* @param {Vec2} a
* @param {Vec2} b
* @param {Number} alpha
* @return {pAdd}
* @return {Vec2}
*/
cc.pLerp = function (a, b, alpha) {
return cc.pAdd(cc.pMult(a, 1 - alpha), cc.pMult(b, alpha));
@@ -543,7 +543,7 @@ cc.pSubIn = function(v1, v2) {
* adds one point to another (inplace).
* @method pAddIn
* @param {Vec2} v1
* @param {point} v2
* @param {Vec2} v2
*/
cc.pAddIn = function(v1, v2) {
v1.x += v2.x;