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 bcb6508a9d..55c2432f28 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) { @@ -1023,8 +1024,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) @@ -1049,7 +1050,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); @@ -1073,7 +1074,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) { @@ -1140,59 +1141,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.