update spirit
This commit is contained in:
@@ -54,17 +54,22 @@ export class Node {
|
||||
public name: string = '';
|
||||
public active: boolean = true;
|
||||
public layer: number = 0;
|
||||
public isValid: boolean = true;
|
||||
public scale: Vec3 = new Vec3(1, 1, 1);
|
||||
|
||||
constructor(name?: string) {
|
||||
this.name = name ?? '';
|
||||
}
|
||||
|
||||
public addChild(_child: Node): void {}
|
||||
public removeFromParent(): void {}
|
||||
public destroy(): void { this.isValid = false; }
|
||||
public on(_ev: string, _cb: (...args: unknown[]) => void, _target?: unknown): void {}
|
||||
public off(_ev: string, _cb?: (...args: unknown[]) => void): void {}
|
||||
public getComponent<T>(_ctor: new (...args: unknown[]) => T): T | null { return null; }
|
||||
public addComponent<T>(_ctor: new (...args: unknown[]) => T): T { return {} as T; }
|
||||
public setPosition(..._args: unknown[]): void {}
|
||||
public setScale(..._args: unknown[]): void {}
|
||||
|
||||
public static EventType = {
|
||||
TOUCH_START: 'touch-start',
|
||||
@@ -158,6 +163,7 @@ export class Label {
|
||||
public horizontalAlign: number = 0;
|
||||
public verticalAlign: number = 0;
|
||||
public useSystemFont: boolean = true;
|
||||
public enableWrapText: boolean = true;
|
||||
}
|
||||
|
||||
export class Button {
|
||||
@@ -181,16 +187,39 @@ export class Sprite {
|
||||
public spriteFrame: unknown = null;
|
||||
public type: number = 0;
|
||||
public sizeMode: number = 0;
|
||||
public color: Color = Color.WHITE;
|
||||
public static Type = { SIMPLE: 0, SLICED: 1, TILED: 2, FILLED: 3 };
|
||||
public static SizeMode = { CUSTOM: 0, TRIMMED: 1, RAW: 2 };
|
||||
}
|
||||
|
||||
export class Rect {
|
||||
public x: number;
|
||||
public y: number;
|
||||
public width: number;
|
||||
public height: number;
|
||||
constructor(x: number = 0, y: number = 0, width: number = 0, height: number = 0) {
|
||||
this.x = x; this.y = y; this.width = width; this.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
export class Size {
|
||||
public width: number;
|
||||
public height: number;
|
||||
constructor(width: number = 0, height: number = 0) {
|
||||
this.width = width; this.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
export class SpriteFrame {
|
||||
public texture: unknown = null;
|
||||
public rect: Rect = new Rect();
|
||||
public originalSize: Size = new Size();
|
||||
}
|
||||
|
||||
export class Texture2D {
|
||||
public image: unknown = null;
|
||||
public width: number = 0;
|
||||
public height: number = 0;
|
||||
public static PixelFormat = { RGBA8888: 35 };
|
||||
}
|
||||
|
||||
@@ -205,6 +234,21 @@ export class JsonAsset {
|
||||
export class Canvas {}
|
||||
export class EventTouch {}
|
||||
|
||||
/** Global input event source (Cocos Creator 3.8). */
|
||||
export const input = {
|
||||
on: (_ev: string, _cb: (...args: unknown[]) => void, _target?: unknown): void => {},
|
||||
off: (_ev: string, _cb?: (...args: unknown[]) => void, _target?: unknown): void => {},
|
||||
};
|
||||
|
||||
export const Input = {
|
||||
EventType: {
|
||||
TOUCH_START: 'touch-start',
|
||||
TOUCH_MOVE: 'touch-move',
|
||||
TOUCH_END: 'touch-end',
|
||||
TOUCH_CANCEL: 'touch-cancel',
|
||||
},
|
||||
};
|
||||
|
||||
export const resources = {
|
||||
load: (_path: string, _type: unknown, _cb: (err: Error | null, asset: unknown) => void): void => {},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user