@galacean/engine-core 2.0.0-alpha.38 → 2.0.0-alpha.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "2.0.0-alpha.38",
3
+ "version": "2.0.0-alpha.39",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -18,10 +18,10 @@
18
18
  "types/**/*"
19
19
  ],
20
20
  "dependencies": {
21
- "@galacean/engine-math": "2.0.0-alpha.38"
21
+ "@galacean/engine-math": "2.0.0-alpha.39"
22
22
  },
23
23
  "devDependencies": {
24
- "@galacean/engine-design": "2.0.0-alpha.38"
24
+ "@galacean/engine-design": "2.0.0-alpha.39"
25
25
  },
26
26
  "scripts": {
27
27
  "b:types": "tsc"
package/types/Canvas.d.ts CHANGED
@@ -1,19 +1,35 @@
1
1
  /**
2
- * Canvas.
2
+ * The canvas the engine renders to; owns the render-buffer resolution.
3
3
  */
4
4
  export declare abstract class Canvas {
5
5
  private _width;
6
6
  private _height;
7
7
  /**
8
- * The width of the canvas.
8
+ * The width component of the canvas resolution, in pixels.
9
9
  */
10
10
  get width(): number;
11
- set width(value: number);
12
11
  /**
13
- *The height of the canvas.
12
+ * The height component of the canvas resolution, in pixels.
14
13
  */
15
14
  get height(): number;
16
- set height(value: number);
17
- protected abstract _onWidthChanged(value: number): void;
18
- protected abstract _onHeightChange(value: number): void;
15
+ /**
16
+ * Lock the render buffer to an explicit resolution and stop following the display size.
17
+ * @param width - Render buffer width in pixels
18
+ * @param height - Render buffer height in pixels
19
+ *
20
+ * @throws
21
+ * Throw an error if width or height is not a positive finite number.
22
+ */
23
+ setResolution(width: number, height: number): void;
24
+ /**
25
+ * Make the render buffer automatically follow the canvas display size.
26
+ * @param scale - Multiplier applied to the device pixel ratio (1 = native sharpness, 0.7 = save GPU, 2 = supersample), defaults to `1`
27
+ *
28
+ * @throws
29
+ * Throw an error if scale is not a positive finite number.
30
+ */
31
+ abstract setAutoResolution(scale?: number): void;
32
+ protected _setResolution(width: number, height: number): void;
33
+ protected _exitAutoResolution(): void;
34
+ protected abstract _onResolutionChanged(width: number, height: number): void;
19
35
  }
@@ -110,6 +110,12 @@ export declare class ResourceManager {
110
110
  private _parseURL;
111
111
  private _parseQueryPath;
112
112
  private _releaseSubAssetPromiseCallback;
113
+ /**
114
+ * Register virtual asset paths and their load descriptors.
115
+ * @remarks References inside runtime scenes and Prefabs can keep stable virtual paths while the backing URLs
116
+ * are generated dynamically, such as object URLs created from a resource package.
117
+ */
118
+ registerVirtualResources(resources: readonly VirtualResource[]): void;
113
119
  }
114
120
  /**
115
121
  * Declare ResourceLoader's decorator.
@@ -119,3 +125,13 @@ export declare class ResourceManager {
119
125
  export declare function resourceLoader(assetType: string, extNames: string[], useCache?: boolean): <T extends Loader<any>>(Target: {
120
126
  new (useCache: boolean): T;
121
127
  }) => void;
128
+ export interface VirtualResource {
129
+ virtualPath: string;
130
+ path: string;
131
+ type: string;
132
+ dependentAssetMap?: {
133
+ [key: string]: string;
134
+ };
135
+ subpackageName?: string;
136
+ params?: Record<string, any>;
137
+ }
package/types/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export type { RequestConfig } from "./asset/request";
23
23
  export { Loader } from "./asset/Loader";
24
24
  export { ContentRestorer } from "./asset/ContentRestorer";
25
25
  export { RenderingStatistics } from "./asset/RenderingStatistics";
26
- export { ResourceManager, resourceLoader } from "./asset/ResourceManager";
26
+ export { ResourceManager, resourceLoader, type VirtualResource } from "./asset/ResourceManager";
27
27
  export { AssetPromise } from "./asset/AssetPromise";
28
28
  export type { LoadItem } from "./asset/LoadItem";
29
29
  export { AssetType } from "./asset/AssetType";