diff --git a/cocos2d/core/load-pipeline/CCLoader.js b/cocos2d/core/load-pipeline/CCLoader.js index 0d3896c581..162b480b0a 100644 --- a/cocos2d/core/load-pipeline/CCLoader.js +++ b/cocos2d/core/load-pipeline/CCLoader.js @@ -184,7 +184,8 @@ JS.mixin(CCLoader.prototype, { * @param {Function} [progressCallback] - Callback invoked when progression change * @param {Function} [completeCallback] - Callback invoked when all resources loaded * @typescript - * load(resources: string|string[]|{uuid: string, url: string, type: string}, progressCallback?: Function, completeCallback?: Function): void + * load(resources: string|string[]|{uuid?: string, url?: string, type?: string}, completeCallback?: Function): void + * load(resources: string|string[]|{uuid?: string, url?: string, type?: string}, progressCallback: Function, completeCallback: Function|null): void */ load: function(resources, progressCallback, completeCallback) { if (completeCallback === undefined) { diff --git a/cocos2d/core/value-types/CCRect.js b/cocos2d/core/value-types/CCRect.js index fc65c73289..62cb68802c 100644 --- a/cocos2d/core/value-types/CCRect.js +++ b/cocos2d/core/value-types/CCRect.js @@ -260,10 +260,9 @@ Object.defineProperty(proto, 'yMax', { }); /** - * !#en TODO + * !#en The position of the center of the rectangle. * !#zh 矩形的中心点。 - * @property center - * @type {Number} + * @property {Vec2} center */ Object.defineProperty(proto, 'center', { get: function () { @@ -277,7 +276,22 @@ Object.defineProperty(proto, 'center', { }); /** - * !#en TODO + * !#en The X and Y position of the rectangle. + * !#zh 矩形的 x 和 y 坐标。 + * @property {Vec2} origin + */ +Object.defineProperty(proto, 'origin', { + get () { + return new cc.Vec2(this.x, this.y); + }, + set (value) { + this.x = value.x; + this.y = value.y; + } +}); + +/** + * !#en Width and height of the rectangle. * !#zh 矩形的大小。 * @property {Size} size */