@galacean/effects-core 2.8.0-alpha.3 → 2.8.0-alpha.5
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/dist/asset-manager.d.ts +2 -1
- package/dist/downloader.d.ts +1 -1
- package/dist/index.js +694 -513
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +692 -513
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-system.d.ts +4 -4
- package/dist/plugins/cal/calculate-loader.d.ts +2 -2
- package/dist/plugins/camera/camera-vfx-item-loader.d.ts +2 -2
- package/dist/plugins/interact/interact-loader.d.ts +2 -2
- package/dist/plugins/particle/particle-loader.d.ts +2 -2
- package/dist/plugins/particle/particle-system.d.ts +2 -1
- package/dist/plugins/plugin.d.ts +24 -19
- package/dist/plugins/sprite/sprite-item.d.ts +0 -1
- package/dist/plugins/sprite/sprite-loader.d.ts +2 -2
- package/dist/plugins/text/text-item.d.ts +16 -1
- package/dist/plugins/text/text-loader.d.ts +2 -2
- package/dist/scene.d.ts +5 -0
- package/dist/utils/hevc-video.d.ts +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +2 -2
package/dist/plugin-system.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Composition } from './composition';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Plugin, PluginConstructor } from './plugins';
|
|
3
3
|
import type { Scene, SceneLoadOptions } from './scene';
|
|
4
4
|
import type { Engine } from './engine';
|
|
5
5
|
export declare const pluginLoaderMap: Record<string, PluginConstructor>;
|
|
@@ -16,10 +16,10 @@ export declare function registerPlugin(name: string, pluginClass: PluginConstruc
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function unregisterPlugin(name: string): void;
|
|
18
18
|
export declare class PluginSystem {
|
|
19
|
-
static getPlugins():
|
|
19
|
+
static getPlugins(): Plugin[];
|
|
20
20
|
static initializeComposition(composition: Composition, scene: Scene): void;
|
|
21
21
|
static destroyComposition(comp: Composition): void;
|
|
22
|
-
static
|
|
23
|
-
static
|
|
22
|
+
static onAssetsLoadStart(scene: Scene, options?: SceneLoadOptions): Promise<void[]>;
|
|
23
|
+
static onAssetsLoadFinish(scene: Scene, options: SceneLoadOptions, engine: Engine): void;
|
|
24
24
|
}
|
|
25
25
|
export declare function getPluginUsageInfo(name: string): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class CalculateLoader extends
|
|
1
|
+
import { Plugin } from '../plugin';
|
|
2
|
+
export declare class CalculateLoader extends Plugin {
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class CameraVFXItemLoader extends
|
|
1
|
+
import { Plugin } from '../plugin';
|
|
2
|
+
export declare class CameraVFXItemLoader extends Plugin {
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class InteractLoader extends
|
|
1
|
+
import { Plugin } from '../plugin';
|
|
2
|
+
export declare class InteractLoader extends Plugin {
|
|
3
3
|
}
|
|
@@ -183,7 +183,8 @@ export declare class ParticleSystem extends Component implements Maskable {
|
|
|
183
183
|
reset(): void;
|
|
184
184
|
onStart(): void;
|
|
185
185
|
onUpdate(dt: number): void;
|
|
186
|
-
|
|
186
|
+
simulate(time: number): void;
|
|
187
|
+
private update;
|
|
187
188
|
drawStencilMask(renderer: Renderer): void;
|
|
188
189
|
onDestroy(): void;
|
|
189
190
|
getParticleBoxes(): {
|
package/dist/plugins/plugin.d.ts
CHANGED
|
@@ -2,35 +2,40 @@ import type { Scene, SceneLoadOptions } from '../scene';
|
|
|
2
2
|
import type { Composition } from '../composition';
|
|
3
3
|
import type { Engine } from '../engine';
|
|
4
4
|
export interface PluginConstructor {
|
|
5
|
-
new ():
|
|
5
|
+
new (): Plugin;
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* 抽象插件类
|
|
10
10
|
* 注册合成不同生命周期的回调函数
|
|
11
11
|
*/
|
|
12
|
-
export declare abstract class
|
|
12
|
+
export declare abstract class Plugin {
|
|
13
13
|
order: number;
|
|
14
14
|
name: string;
|
|
15
|
-
initialize(): void;
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param scene
|
|
20
|
-
* @param options
|
|
21
|
-
* @returns
|
|
16
|
+
* 场景加载时触发,用于加载插件所需的自定义资源。
|
|
17
|
+
* 此阶段适合发起异步资源请求。
|
|
18
|
+
* @param scene - 场景对象
|
|
19
|
+
* @param options - 场景加载选项
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
onAssetsLoadStart(scene: Scene, options?: SceneLoadOptions): Promise<void>;
|
|
24
22
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @param {Scene} scene
|
|
31
|
-
* @param {SceneLoadOptions} options
|
|
23
|
+
* 场景资源加载完成后触发。
|
|
24
|
+
* 此时 JSON 中的图片和二进制已加载完成,可对资源做进一步处理。
|
|
25
|
+
* @param scene - 场景对象
|
|
26
|
+
* @param options - 场景加载选项
|
|
27
|
+
* @param engine - 引擎实例
|
|
32
28
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
onAssetsLoadFinish(scene: Scene, options: SceneLoadOptions, engine: Engine): void;
|
|
30
|
+
/**
|
|
31
|
+
* 合成创建完成后触发。
|
|
32
|
+
* @param composition - 合成对象
|
|
33
|
+
* @param scene - 场景对象
|
|
34
|
+
*/
|
|
35
|
+
onCompositionCreated(composition: Composition, scene: Scene): void;
|
|
36
|
+
/**
|
|
37
|
+
* 合成销毁时触发。
|
|
38
|
+
* @param composition - 合成对象
|
|
39
|
+
*/
|
|
40
|
+
onCompositionDestroy(composition: Composition): void;
|
|
36
41
|
}
|
|
@@ -41,7 +41,6 @@ export declare class ComponentTimePlayable extends Playable {
|
|
|
41
41
|
export declare class SpriteComponent extends MaskableGraphic {
|
|
42
42
|
time: number;
|
|
43
43
|
duration: number;
|
|
44
|
-
loop: boolean;
|
|
45
44
|
protected textureSheetAnimation?: spec.TextureSheetAnimation;
|
|
46
45
|
constructor(engine: Engine, props?: spec.SpriteComponentData);
|
|
47
46
|
onUpdate(dt: number): void;
|
|
@@ -26,6 +26,14 @@ export declare class TextComponent extends MaskableGraphic implements ITextCompo
|
|
|
26
26
|
* 每一行文本的最大宽度
|
|
27
27
|
*/
|
|
28
28
|
protected maxLineWidth: number;
|
|
29
|
+
/**
|
|
30
|
+
* 初始文本宽度,用于计算缩放比例
|
|
31
|
+
*/
|
|
32
|
+
private baseTextWidth;
|
|
33
|
+
/**
|
|
34
|
+
* 初始 `transform.size.x`,用于按比例更新显示宽度
|
|
35
|
+
*/
|
|
36
|
+
private baseScaleX;
|
|
29
37
|
private getDefaultProps;
|
|
30
38
|
constructor(engine: Engine);
|
|
31
39
|
onUpdate(dt: number): void;
|
|
@@ -36,7 +44,7 @@ export declare class TextComponent extends MaskableGraphic implements ITextCompo
|
|
|
36
44
|
/**
|
|
37
45
|
* 根据配置更新文本样式和布局
|
|
38
46
|
*/
|
|
39
|
-
|
|
47
|
+
updateWithOptions(options: spec.TextContentOptions): void;
|
|
40
48
|
getLineCount(text: string): number;
|
|
41
49
|
/**
|
|
42
50
|
* 设置行高
|
|
@@ -88,6 +96,13 @@ export declare class TextComponent extends MaskableGraphic implements ITextCompo
|
|
|
88
96
|
protected updateTexture(flipY?: boolean): void;
|
|
89
97
|
renderText(options: spec.TextContentOptions): void;
|
|
90
98
|
setAutoWidth(value: boolean): void;
|
|
99
|
+
/**
|
|
100
|
+
* 设置文本框宽度
|
|
101
|
+
* 手动设置宽度时会自动关闭 `autoWidth`
|
|
102
|
+
* 同时会按比例更新 `transform.size.x`,让 UI 框宽度也跟着变化
|
|
103
|
+
* @param value - 文本框宽度
|
|
104
|
+
*/
|
|
105
|
+
setTextWidth(value: number): void;
|
|
91
106
|
setFontSize(value: number): void;
|
|
92
107
|
setOutlineWidth(value: number): void;
|
|
93
108
|
setShadowBlur(value: number): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TextLoader extends
|
|
1
|
+
import { Plugin } from '../index';
|
|
2
|
+
export declare class TextLoader extends Plugin {
|
|
3
3
|
}
|
package/dist/scene.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
/**
|
|
3
|
+
* Check if the browser can play the given HEVC codec.
|
|
4
|
+
* @param codec - The HEVC codec to check.
|
|
5
|
+
* @returns True if the browser can probably or maybe play the codec, false otherwise.
|
|
6
|
+
*/
|
|
7
|
+
export declare function canPlayHevcCodec(codec: spec.HevcVideoCodec): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Parse the given codec string into a HEVC video codec enum value.
|
|
10
|
+
* @param codec - The codec string to parse.
|
|
11
|
+
* @returns The corresponding HEVC video codec enum value, or undefined if the codec is invalid.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseCodec(codec: string): spec.HevcVideoCodec | undefined;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './image-data';
|
|
|
5
5
|
export * from './sortable';
|
|
6
6
|
export * from './asserts';
|
|
7
7
|
export * from './text';
|
|
8
|
+
export * from './hevc-video';
|
|
8
9
|
export * from './promise-util';
|
|
9
10
|
export * from './logger';
|
|
10
11
|
export type Immutable<O> = O extends Record<any, any> ? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-core",
|
|
3
|
-
"version": "2.8.0-alpha.
|
|
3
|
+
"version": "2.8.0-alpha.5",
|
|
4
4
|
"description": "Galacean Effects runtime core for the web",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"registry": "https://registry.npmjs.org"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@galacean/effects-specification": "2.7.0
|
|
45
|
+
"@galacean/effects-specification": "2.7.0",
|
|
46
46
|
"@galacean/effects-math": "1.1.0",
|
|
47
47
|
"flatbuffers": "24.3.25",
|
|
48
48
|
"uuid": "9.0.1",
|