mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
add Rect.origin
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user