添加内部属性标记

This commit is contained in:
宫欣海
2025-03-07 16:02:00 +08:00
parent b6551e9bbf
commit 897d618a0b
71 changed files with 909 additions and 220 deletions

View File

@@ -11,6 +11,7 @@ import { Screen } from "./Screen";
import { size } from "./header";
export abstract class Adapter {
/** @internal */
public init() {
// 设计尺寸 不会变化
let designSize = this.getDesignSize();
@@ -25,6 +26,7 @@ export abstract class Adapter {
});
}
/** @internal */
protected resize(): void {
Screen.SafeAreaHeight = 60;
// 屏幕像素尺寸
@@ -55,6 +57,7 @@ export abstract class Adapter {
this.printScreen();
}
/** @internal */
private printScreen() {
info(`设计分辨率: ${Screen.DesignWidth}x${Screen.DesignHeight}`);
info(`屏幕分辨率: ${Screen.ScreenWidth}x${Screen.ScreenHeight}`);

View File

@@ -7,6 +7,7 @@
import { EventManager } from "../event/EventManager";
export class GlobalEvent {
/** @internal */
private static _globalEvent: EventManager = null;
public static add(eventName: string, callback: (...args: any[]) => void, target: any): void {
this._globalEvent.addEvent(eventName, callback, target);
@@ -36,6 +37,7 @@ export class GlobalEvent {
this._globalEvent.removeList(target);
}
/** @internal */
public static _initGlobalEvent(): void {
if (!this._globalEvent) {
this._globalEvent = new EventManager();

View File

@@ -7,10 +7,12 @@
import { Timer } from "../tool/timer/Timer";
export class GlobalTimer {
/** @internal */
private static _timer: Timer = null;
/**
* 初始化全局定时器设置定时器间隔为16毫秒。
* 此方法用于启动一个定时器实例,以便在整个应用程序中跟踪时间相关的操作。
* @internal
*/
public static initTimer(): void {
this._timer = new Timer(16);
@@ -19,6 +21,7 @@ export class GlobalTimer {
/**
* 获取全局定时器实例。如果定时器尚未初始化,则进行初始化。
* @returns {Timer} 全局定时器实例
* @internal
*/
public static get Timer(): Timer {
if (this._timer) {
@@ -70,6 +73,11 @@ export class GlobalTimer {
this.Timer.clear();
}
/**
* 更新定时器
* @param dt - 时间间隔
* @internal
*/
public static update(dt: number): void {
this._timer?.update(dt);
}

View File

@@ -5,6 +5,7 @@
*/
import { Timer } from "../tool/timer/Timer";
/** @internal */
export class InnerTimer {
private static _timer: Timer = null;
/**