add Rect.origin

This commit is contained in:
Jare Guo
2017-04-26 17:44:01 +08:00
parent f054f504b6
commit 261c654b14
2 changed files with 20 additions and 5 deletions
+2 -1
View File
@@ -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) {
+18 -4
View File
@@ -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
*/