From 6d2c1de29f5d9751c64afe21bf2b2082d56df3d7 Mon Sep 17 00:00:00 2001
From: Nan Wang
Date: Tue, 23 Feb 2016 15:37:34 +0800
Subject: [PATCH] fix multiple class types.
---
cocos2d/core/CCActionManager.js | 8 +-
cocos2d/core/CCDirector.js | 2 +-
cocos2d/core/CCNode.js | 80 ++++++++++---------
cocos2d/core/CCScheduler.js | 32 ++++----
cocos2d/core/base-nodes/CCSGNode.js | 2 +-
cocos2d/core/event-manager/CCEventListener.js | 2 +-
cocos2d/core/sprites/CCSpriteFrame.js | 14 ++--
cocos2d/core/support/TransformUtils.js | 4 +-
cocos2d/core/value-types/CCAffineTransform.js | 6 +-
cocos2d/core/value-types/CCVec2.js | 6 +-
extensions/spine/SGSkeleton.js | 4 +-
extensions/spine/Skeleton.js | 2 +-
12 files changed, 85 insertions(+), 77 deletions(-)
diff --git a/cocos2d/core/CCActionManager.js b/cocos2d/core/CCActionManager.js
index 62f1cee527..7712b9b651 100644
--- a/cocos2d/core/CCActionManager.js
+++ b/cocos2d/core/CCActionManager.js
@@ -91,8 +91,8 @@ cc.ActionManager = cc._Class.extend(/** @lends cc.ActionManager# */{
* If the target is not present, a new instance of this target will be created either paused or not, and the action will be added to the newly created target.
* When the target is paused, the queued actions won't be 'ticked'.
* @method addAction
- * @param {cc.Action} action
- * @param {cc.Node} target
+ * @param {Action} action
+ * @param {Node} target
* @param {Boolean} paused
*/
addAction:function (action, target, paused) {
@@ -155,7 +155,7 @@ cc.ActionManager = cc._Class.extend(/** @lends cc.ActionManager# */{
},
/** Removes an action given an action reference.
* @method removeAction
- * @param {cc.Action} action
+ * @param {Action} action
*/
removeAction:function (action) {
// explicit null handling
@@ -205,7 +205,7 @@ cc.ActionManager = cc._Class.extend(/** @lends cc.ActionManager# */{
* @method getActionByTag
* @param {Number} tag
* @param {object} target
- * @return {cc.Action|Null} return the Action with the given tag on success
+ * @return {Action|Null} return the Action with the given tag on success
*/
getActionByTag:function (tag, target) {
if(tag === cc.ACTION_TAG_INVALID)
diff --git a/cocos2d/core/CCDirector.js b/cocos2d/core/CCDirector.js
index fa45e8a344..ad7ec6c22f 100644
--- a/cocos2d/core/CCDirector.js
+++ b/cocos2d/core/CCDirector.js
@@ -1106,7 +1106,7 @@ cc.Director.EVENT_BEFORE_SCENE_LAUNCH = "director_before_scene_launch";
/**
* @event EVENT_AFTER_SCENE_LAUNCH
- * @param {cc.Scene} newScene
+ * @param {Scene} newScene
*/
cc.Director.EVENT_AFTER_SCENE_LAUNCH = "director_after_scene_launch";
diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js
index 5459924b23..01a9873192 100644
--- a/cocos2d/core/CCNode.js
+++ b/cocos2d/core/CCNode.js
@@ -34,7 +34,7 @@ var DontDestroy = Flags.DontDestroy;
/**
* The event type supported by Node
- * @class Node.EventType
+ * @enum Node.EventType
* @static
* @namespace Node
*/
@@ -43,7 +43,7 @@ var EventType = cc.Enum({
* The event type for touch start event, you can use its value directly: 'touchstart'
* @property TOUCH_START
* @type {String}
- * @readonly
+ * @static
*/
TOUCH_START: 'touchstart',
/**
@@ -51,21 +51,21 @@ var EventType = cc.Enum({
* @property TOUCH_MOVE
* @type {String}
* @value 1
- * @readonly
+ * @static
*/
TOUCH_MOVE: 'touchmove',
/**
* The event type for touch end event, you can use its value directly: 'touchend'
* @property TOUCH_END
* @type {String}
- * @readonly
+ * @static
*/
TOUCH_END: 'touchend',
/**
* The event type for touch end event, you can use its value directly: 'touchcancel'
* @property TOUCH_CANCEL
* @type {String}
- * @readonly
+ * @static
*/
TOUCH_CANCEL: 'touchcancel',
@@ -73,42 +73,42 @@ var EventType = cc.Enum({
* The event type for mouse down events, you can use its value directly: 'mousedown'
* @property MOUSE_DOWN
* @type {String}
- * @readonly
+ * @static
*/
MOUSE_DOWN: 'mousedown',
/**
* The event type for mouse move events, you can use its value directly: 'mousemove'
* @property MOUSE_MOVE
* @type {String}
- * @readonly
+ * @static
*/
MOUSE_MOVE: 'mousemove',
/**
* The event type for mouse enter target events, you can use its value directly: 'mouseenter'
* @property MOUSE_ENTER
* @type {String}
- * @readonly
+ * @static
*/
MOUSE_ENTER: 'mouseenter',
/**
* The event type for mouse leave target events, you can use its value directly: 'mouseleave'
* @property MOUSE_LEAVE
* @type {String}
- * @readonly
+ * @static
*/
MOUSE_LEAVE: 'mouseleave',
/**
* The event type for mouse up events, you can use its value directly: 'mouseup'
* @property MOUSE_UP
* @type {String}
- * @readonly
+ * @static
*/
MOUSE_UP: 'mouseup',
/**
* The event type for mouse wheel events, you can use its value directly: 'mousewheel'
* @property MOUSE_WHEEL
* @type {String}
- * @readonly
+ * @static
*/
MOUSE_WHEEL: 'mousewheel',
});
@@ -233,7 +233,8 @@ var _searchMaskParent = function (node) {
/**
- * Class of all entities in Fireball scenes.
+ * Class of all entities in Cocos Creator scenes.
+ * For events supported by Node, please refer to {{#crossLink "Node.EventType"}}{{/crossLink}}
*
* @class Node
* @extends _BaseNode
@@ -635,8 +636,8 @@ var Node = cc.Class({
/**
* @method _getDependComponent
- * @param {cc.Component} depended
- * @return {cc.Component}
+ * @param {Component} depended
+ * @return {Component}
* @private
*/
_getDependComponent: CC_EDITOR && function (depended) {
@@ -1021,8 +1022,8 @@ var Node = cc.Class({
* The node becomes the action's target. Refer to cc.Action's getTarget()
* Calling runAction while the node is not active won't have any effect
* @method runAction
- * @param {cc.Action} action
- * @return {cc.Action} An Action pointer
+ * @param {Action} action
+ * @return {Action} An Action pointer
*/
runAction: function (action) {
if (!this.active)
@@ -1047,7 +1048,7 @@ var Node = cc.Class({
/**
* Stops and removes an action from the running action list.
* @method stopAction
- * @param {cc.Action} action An action object to be removed.
+ * @param {Action} action An action object to be removed.
*/
stopAction: function (action) {
cc.director.getActionManager().removeAction(action);
@@ -1071,7 +1072,7 @@ var Node = cc.Class({
* @method getActionByTag
* @see cc.Action#getTag and cc.Action#setTag
* @param {Number} tag
- * @return {cc.Action} The action object with the given tag.
+ * @return {Action} The action object with the given tag.
*/
getActionByTag: function (tag) {
if (tag === cc.ACTION_TAG_INVALID) {
@@ -1138,59 +1139,66 @@ if (cc.sys.isNative) {
/**
* @event position-changed
- * @param {cc.Event} event
- * @param {cc.Vec2} event.detail - old position
+ * @param {Event} event
+ * @param {Vec2} event.detail - old position
*/
/**
* @event rotation-changed
- * @param {cc.Event} event
+ * @param {Event} event
* @param {Number} event.detail - old rotation x
*/
/**
* @event scale-changed
- * @param {cc.Event} event
- * @param {cc.Vec2} event.detail - old scale
+ * @param {Event} event
+ * @param {Vec2} event.detail - old scale
*/
/**
* @event size-changed
- * @param {cc.Event} event
- * @param {cc.Size} event.detail - old size
+ * @param {Event} event
+ * @param {Size} event.detail - old size
*/
/**
* @event anchor-changed
- * @param {cc.Event} event
- * @param {cc.Vec2} event.detail - old anchor
+ * @param {Event} event
+ * @param {Vec2} event.detail - old anchor
*/
/**
* @event color-changed
- * @param {cc.Event} event
- * @param {cc.Color} event.detail - old color
+ * @param {Event} event
+ * @param {Color} event.detail - old color
*/
/**
* @event opacity-changed
- * @param {cc.Event} event
+ * @param {Event} event
* @param {Number} event.detail - old opacity
*/
/**
* @event child-added
- * @param {cc.Event} event
- * @param {cc.Node} event.detail - child
+ * @param {Event} event
+ * @param {Node} event.detail - child
*/
/**
* @event child-removed
- * @param {cc.Event} event
- * @param {cc.Node} event.detail - child
+ * @param {Event} event
+ * @param {Node} event.detail - child
*/
/**
* @event child-reorder
- * @param {cc.Event} event
+ * @param {Event} event
*/
/**
* Note: This event is only emitted from the top most node whose active value did changed,
* not including its child nodes.
* @event active-in-hierarchy-changed
- * @param {cc.Event} event
+ * @param {Event} event
*/
+
+/**
+ *
+ * @event touchstart
+ *
+ */
+
Node.EventType = EventType;
cc.Node = module.exports = Node;
diff --git a/cocos2d/core/CCScheduler.js b/cocos2d/core/CCScheduler.js
index af1dab217f..34a880ec24 100644
--- a/cocos2d/core/CCScheduler.js
+++ b/cocos2d/core/CCScheduler.js
@@ -39,10 +39,10 @@ cc.PRIORITY_NON_SYSTEM = cc.PRIORITY_SYSTEM + 1;
/**
* A list double-linked list used for "updates with priority"
* @class ListEntry
- * @param {cc.ListEntry} prev
- * @param {cc.ListEntry} next
+ * @param {ListEntry} prev
+ * @param {ListEntry} next
* @param {function} callback
- * @param {cc._Class} target not retained (retained by hashUpdateEntry)
+ * @param {Object} target not retained (retained by hashUpdateEntry)
* @param {Number} priority
* @param {Boolean} paused
* @param {Boolean} markedForDeletion selector will no longer be called and entry will be removed at end of the next tick
@@ -64,8 +64,8 @@ cc.ListEntry.prototype.trigger = function (dt) {
* A update entry list
* @class HashUpdateEntry
* @param {Array} list Which list does it belong to ?
- * @param {cc.ListEntry} entry entry in the list
- * @param {cc._Class} target hash key (retained)
+ * @param {ListEntry} entry entry in the list
+ * @param {Object} target hash key (retained)
* @param {function} callback
* @param {Array} hh
*/
@@ -82,9 +82,9 @@ cc.HashUpdateEntry = function (list, entry, target, callback, hh) {
* Hash Element used for "selectors with interval"
* @class HashTimerEntry
* @param {Array} timers
- * @param {cc._Class} target hash key (retained)
+ * @param {Object} target hash key (retained)
* @param {Number} timerIndex
- * @param {cc.Timer} currentTimer
+ * @param {Timer} currentTimer
* @param {Boolean} currentTimerSalvaged
* @param {Boolean} paused
* @param {Array} hh
@@ -524,7 +524,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
*
* @method scheduleCallbackForTarget
* @deprecated since v3.4 please use .schedule
- * @param {_Class} target
+ * @param {Object} target
* @param {function} callback_fn
* @param {Number} interval
* @param {Number} repeat
@@ -541,7 +541,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
* The schedule
* @method schedule
* @param {Function} callback
- * @param {_Class} target
+ * @param {Object} target
* @param {Number} interval
* @param {Number} repeat
* @param {Number} delay
@@ -918,7 +918,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
* If the target is not present, nothing happens.
*
* @method pauseTarget
- * @param {_Class} target
+ * @param {Object} target
*/
pauseTarget:function (target) {
@@ -944,7 +944,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
* The 'target' will be unpaused, so all schedule selectors/update will be 'ticked' again.
* If the target is not present, nothing happens.
* @method resumeTarget
- * @param {_Class} target
+ * @param {Object} target
*/
resumeTarget:function (target) {
@@ -970,7 +970,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
/**
* Returns whether or not the target is paused
* @method isTargetPaused
- * @param {_Class} target
+ * @param {Object} target
* @return {Boolean}
*/
isTargetPaused:function (target) {
@@ -998,7 +998,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
*
* @method scheduleUpdateForTarget
* @deprecated since v3.4 please use .scheduleUpdate
- * @param {_Class} target
+ * @param {Object} target
* @param {Number} priority
* @param {Boolean} paused
* @example {@link utils/api/engine/docs/cocos2d/core/CCScheduler/scheduleUpdateForTarget.js}
@@ -1015,7 +1015,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
*
* @method unscheduleCallbackForTarget
* @deprecated since v3.4 please use .unschedule
- * @param {_Class} target
+ * @param {Object} target
* @param {Function} callback - callback[Function] or key[String]
* @example {@link utils/api/engine/docs/cocos2d/core/CCScheduler/unscheduleCallbackForTarget.js}
*/
@@ -1027,7 +1027,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
/**
* Unschedules the update callback function for a given target
* @method unscheduleUpdateForTarget
- * @param {_Class} target
+ * @param {Object} target
* @deprecated since v3.4 please use .unschedule
* @example {@link utils/api/engine/docs/cocos2d/core/CCScheduler/unscheduleUpdateForTarget.js}
*/
@@ -1040,7 +1040,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
* Unschedules all function callbacks for a given target. This also includes the "update" callback function.
* @method unscheduleAllCallbacksForTarget
* @deprecated since v3.4 please use .unscheduleAll
- * @param {_Class} target
+ * @param {Object} target
*/
unscheduleAllCallbacksForTarget: function(target){
//cc.log("unscheduleAllCallbacksForTarget is deprecated. Please use unscheduleAll.");
diff --git a/cocos2d/core/base-nodes/CCSGNode.js b/cocos2d/core/base-nodes/CCSGNode.js
index 0e73d0c6a6..5e8591c386 100644
--- a/cocos2d/core/base-nodes/CCSGNode.js
+++ b/cocos2d/core/base-nodes/CCSGNode.js
@@ -88,7 +88,7 @@ cc.s_globalOrderOfArrival = 1;
* -# The node will be moved according to the camera values (camera)
* -# The grid will render the captured screen
*
- * @class
+ * @class _ccsg.Node
* @extends cc._Class
*
* @property {Number} x - x axis position of node
diff --git a/cocos2d/core/event-manager/CCEventListener.js b/cocos2d/core/event-manager/CCEventListener.js
index deeb05c800..32297380c9 100644
--- a/cocos2d/core/event-manager/CCEventListener.js
+++ b/cocos2d/core/event-manager/CCEventListener.js
@@ -141,7 +141,7 @@ cc.EventListener = cc._Class.extend(/** @lends cc.EventListener# */{
/**
* Sets scene graph priority for this listener
- * @param {_ccsg.Node|cc.Node} node
+ * @param {_ccsg.Node|Node} node
* @private
*/
_setSceneGraphPriority: function (node) {
diff --git a/cocos2d/core/sprites/CCSpriteFrame.js b/cocos2d/core/sprites/CCSpriteFrame.js
index c5f341cf10..3f8bb99923 100644
--- a/cocos2d/core/sprites/CCSpriteFrame.js
+++ b/cocos2d/core/sprites/CCSpriteFrame.js
@@ -410,7 +410,7 @@ cc.SpriteFrame = cc.Class(/** @lends cc.SpriteFrame# */{
* Initializes SpriteFrame with Texture, rect, rotated, offset and originalSize in pixels.
* Please pass parameters to the constructor to initialize the sprite, do not call this function yourself.
* @method initWithTexture
- * @param {String|cc.Texture2D} texture
+ * @param {String|Texture2D} texture
* @param {Rect} rect - if parameters' length equal 2, rect in points, else rect in pixels
* @param {Boolean} [rotated=false]
* @param {Vec2} [offset=cc.v2(0,0)]
@@ -560,7 +560,7 @@ proto.copyWithZone = proto.clone;
/**
* Copy the sprite frame
* @method copy
- * @returns {cc.SpriteFrame}
+ * @returns {SpriteFrame}
*/
proto.copy = proto.clone;
@@ -571,12 +571,12 @@ proto.copy = proto.clone;
*
* since v3.0, please use new constructor {{#crossLink "SpriteFrame/SpriteFrame:method"}}SpriteFrame(){{/crossLink}} instead.
* @method create
- * @param {String|cc.Texture2D} filename
- * @param {cc.Rect} rect if parameters' length equal 2, rect in points, else rect in pixels
+ * @param {String|Texture2D} filename
+ * @param {Rect} rect if parameters' length equal 2, rect in points, else rect in pixels
* @param {Boolean} rotated
- * @param {cc.Vec2} offset
- * @param {cc.Size} originalSize
- * @return {cc.SpriteFrame}
+ * @param {Vec2} offset
+ * @param {Size} originalSize
+ * @return {SpriteFrame}
*/
cc.SpriteFrame.create = function (filename, rect, rotated, offset, originalSize) {
return new cc.SpriteFrame(filename, rect, rotated, offset, originalSize);
diff --git a/cocos2d/core/support/TransformUtils.js b/cocos2d/core/support/TransformUtils.js
index aa23c70ed1..b7db840601 100644
--- a/cocos2d/core/support/TransformUtils.js
+++ b/cocos2d/core/support/TransformUtils.js
@@ -34,7 +34,7 @@
/**
* convert an affine transform object to a kmMat4 object
* @method CGAffineToGL
- * @param {cc.AffineTransform} trans
+ * @param {AffineTransform} trans
* @param {cc.kmMat4} mat
*/
cc.CGAffineToGL = function (trans, mat) {
@@ -56,7 +56,7 @@ cc.CGAffineToGL = function (trans, mat) {
* Convert a kmMat4 object to an affine transform object
* @method GLToCGAffine
* @param {cc.kmMat4} mat
- * @param {cc.AffineTransform} trans
+ * @param {AffineTransform} trans
*/
cc.GLToCGAffine = function (mat, trans) {
trans.a = mat[0];
diff --git a/cocos2d/core/value-types/CCAffineTransform.js b/cocos2d/core/value-types/CCAffineTransform.js
index 69b5ccd404..cd9bf1f429 100644
--- a/cocos2d/core/value-types/CCAffineTransform.js
+++ b/cocos2d/core/value-types/CCAffineTransform.js
@@ -260,9 +260,9 @@ cc.affineTransformConcat = function (t1, t2) {
* The results are reflected in the first matrix.
* t' = t1 * t2
* @method affineTransformConcatIn
- * @param {cc.AffineTransform} t1 - The first transform object.
- * @param {cc.AffineTransform} t2 - The transform object to concatenate.
- * @return {cc.AffineTransform} The result of concatenation.
+ * @param {AffineTransform} t1 - The first transform object.
+ * @param {AffineTransform} t2 - The transform object to concatenate.
+ * @return {AffineTransform} The result of concatenation.
*/
cc.affineTransformConcatIn = function (t1, t2) {
var a = t1.a, b = t1.b, c = t1.c, d = t1.d, tx = t1.tx, ty = t1.ty;
diff --git a/cocos2d/core/value-types/CCVec2.js b/cocos2d/core/value-types/CCVec2.js
index c19749576c..03808cd2d5 100644
--- a/cocos2d/core/value-types/CCVec2.js
+++ b/cocos2d/core/value-types/CCVec2.js
@@ -467,7 +467,7 @@ cc.v2 = function v2 (x, y) {
* @method p
* @param {Number|Object} [x=0] a Number or a size object
* @param {Number} [y=0]
- * @return {cc.Vec2}
+ * @return {Vec2}
* @example
* var point1 = cc.p();
* var point2 = cc.p(100, 100);
@@ -482,8 +482,8 @@ cc.p = cc.v2;
/**
* Check whether a point's value equals to another
* @method pointEqualToPoint
- * @param {cc.Vec2} point1
- * @param {cc.Vec2} point2
+ * @param {Vec2} point1
+ * @param {Vec2} point2
* @return {Boolean}
*/
cc.pointEqualToPoint = function (point1, point2) {
diff --git a/extensions/spine/SGSkeleton.js b/extensions/spine/SGSkeleton.js
index 150a9d2306..5d2ca1a7b0 100644
--- a/extensions/spine/SGSkeleton.js
+++ b/extensions/spine/SGSkeleton.js
@@ -299,7 +299,7 @@ sp._SGSkeleton = _ccsg.Node.extend({
/**
* Returns the blendFunc of sp._SGSkeleton.
- * @returns {cc.BlendFunc}
+ * @returns {BlendFunc}
*/
getBlendFunc: function () {
return this._blendFunc;
@@ -307,7 +307,7 @@ sp._SGSkeleton = _ccsg.Node.extend({
/**
* Sets the blendFunc of sp._SGSkeleton.
- * @param {cc.BlendFunc|Number} src
+ * @param {BlendFunc|Number} src
* @param {Number} [dst]
*/
setBlendFunc: function (src, dst) {
diff --git a/extensions/spine/Skeleton.js b/extensions/spine/Skeleton.js
index 47483e44ee..4fd5defa42 100644
--- a/extensions/spine/Skeleton.js
+++ b/extensions/spine/Skeleton.js
@@ -64,7 +64,7 @@ sp.Skeleton = cc.Class({
* The skeleton data contains the skeleton information (bind pose bones, slots, draw order,
* attachments, skins, etc) and animations but does not hold any state.
* Multiple skeletons can share the same skeleton data.
- * @property {sp.SkeletonData} skeletonData
+ * @property {SkeletonData} skeletonData
*/
skeletonData: {
default: null,