@galacean/effects-core 2.9.0-alpha.0 → 2.9.0-alpha.1
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 -0
- package/dist/asset-service.d.ts +0 -1
- package/dist/camera.d.ts +2 -2
- package/dist/components/composition-component.d.ts +24 -5
- package/dist/components/frame-component.d.ts +3 -0
- package/dist/components/renderer-component.d.ts +7 -0
- package/dist/composition.d.ts +6 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13996 -13713
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13995 -13714
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/text/text-component-base.d.ts +50 -0
- package/dist/plugins/text/text-item.d.ts +36 -39
- package/dist/plugins/timeline/playable.d.ts +2 -1
- package/dist/plugins/timeline/timeline-asset.d.ts +1 -4
- package/dist/precompositions/index.d.ts +2 -0
- package/dist/precompositions/precomposition-manager.d.ts +13 -0
- package/dist/precompositions/precomposition.d.ts +7 -0
- package/dist/scene-loader.d.ts +3 -0
- package/dist/scene.d.ts +0 -1
- package/dist/vfx-item.d.ts +11 -7
- package/package.json +2 -2
|
@@ -10,6 +10,9 @@ import type { TextStyle } from './text-style';
|
|
|
10
10
|
*/
|
|
11
11
|
export interface IRichTextComponent {
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* 文本组件基础类,包含文本组件和富文本组件的共有逻辑
|
|
15
|
+
*/
|
|
13
16
|
export declare class TextComponentBase {
|
|
14
17
|
textStyle: TextStyle;
|
|
15
18
|
textLayout: BaseLayout;
|
|
@@ -23,20 +26,67 @@ export declare class TextComponentBase {
|
|
|
23
26
|
renderer: ItemRenderer;
|
|
24
27
|
protected maxLineWidth: number;
|
|
25
28
|
protected readonly ALPHA_FIX_VALUE: number;
|
|
29
|
+
/**
|
|
30
|
+
* 设置文本内容
|
|
31
|
+
* @param value - 文本内容
|
|
32
|
+
*/
|
|
26
33
|
setText(value: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* 设置文本水平布局
|
|
36
|
+
* @param value - 布局选项
|
|
37
|
+
*/
|
|
27
38
|
setTextAlign(value: spec.TextAlignment): void;
|
|
39
|
+
/**
|
|
40
|
+
* 设置文本垂直布局
|
|
41
|
+
* @param value - 布局选项
|
|
42
|
+
*/
|
|
28
43
|
setTextVerticalAlign(value: spec.TextVerticalAlign): void;
|
|
29
44
|
/**
|
|
30
45
|
* @deprecated 2.8.0 本方法已废弃,请使用 setTextVerticalAlign 替代。
|
|
31
46
|
*/
|
|
32
47
|
setTextBaseline(value: spec.TextBaseline): void;
|
|
48
|
+
/**
|
|
49
|
+
* 设置文本颜色
|
|
50
|
+
* @param value - 颜色内容
|
|
51
|
+
* @default [1, 1, 1, 1]
|
|
52
|
+
*/
|
|
33
53
|
setTextColor(value: spec.RGBAColorValue): void;
|
|
54
|
+
/**
|
|
55
|
+
* 设置字体
|
|
56
|
+
* @param value - 字体名称,如:"Arial", "Times New Roman" 等
|
|
57
|
+
* @default "sans-serif"
|
|
58
|
+
*/
|
|
34
59
|
setFontFamily(value: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* 设置字重
|
|
62
|
+
* @param value - 字重类型
|
|
63
|
+
*/
|
|
35
64
|
setFontWeight(value: spec.TextWeight): void;
|
|
65
|
+
/**
|
|
66
|
+
* 设置字体样式
|
|
67
|
+
* @param value - 字体样式
|
|
68
|
+
* @default "normal"
|
|
69
|
+
*/
|
|
36
70
|
setFontStyle(value: spec.FontStyle): void;
|
|
71
|
+
/**
|
|
72
|
+
* 设置外描边文本颜色
|
|
73
|
+
* @param value - 颜色内容
|
|
74
|
+
*/
|
|
37
75
|
setOutlineColor(value: spec.RGBAColorValue): void;
|
|
76
|
+
/**
|
|
77
|
+
* 设置是否启用外描边
|
|
78
|
+
* @param value - 是否启用外描边
|
|
79
|
+
*/
|
|
38
80
|
setOutlineEnabled(value: boolean): void;
|
|
81
|
+
/**
|
|
82
|
+
* 设置字体清晰度
|
|
83
|
+
* @param value - 字体清晰度
|
|
84
|
+
*/
|
|
39
85
|
setFontScale(value: number): void;
|
|
86
|
+
/**
|
|
87
|
+
* 设置文本溢出方式
|
|
88
|
+
* @param overflow - 溢出方式
|
|
89
|
+
*/
|
|
40
90
|
setOverflow(overflow: spec.TextOverflow): void;
|
|
41
91
|
protected getFontDesc(size?: number): string;
|
|
42
92
|
protected setupOutline(): void;
|
|
@@ -41,6 +41,11 @@ export declare class TextComponent extends MaskableGraphic {
|
|
|
41
41
|
* 根据配置更新文本样式和布局
|
|
42
42
|
*/
|
|
43
43
|
updateWithOptions(options: spec.TextContentOptions): void;
|
|
44
|
+
/**
|
|
45
|
+
* 获取文本行数
|
|
46
|
+
* @param text - 文本内容
|
|
47
|
+
* @returns 行数
|
|
48
|
+
*/
|
|
44
49
|
getLineCount(text: string): number;
|
|
45
50
|
/**
|
|
46
51
|
* 设置行高
|
|
@@ -48,46 +53,8 @@ export declare class TextComponent extends MaskableGraphic {
|
|
|
48
53
|
* @param value - 行高像素值
|
|
49
54
|
*/
|
|
50
55
|
setLineHeight(value: number): void;
|
|
51
|
-
/**
|
|
52
|
-
* 设置字重
|
|
53
|
-
* @param value - 字重类型
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
setFontWeight(value: spec.TextWeight): void;
|
|
57
|
-
/**
|
|
58
|
-
* 设置字体样式
|
|
59
|
-
* @param value 设置字体样式
|
|
60
|
-
* @default "normal"
|
|
61
|
-
* @returns
|
|
62
|
-
*/
|
|
63
|
-
setFontStyle(value: spec.FontStyle): void;
|
|
64
|
-
/**
|
|
65
|
-
* 设置文本水平布局
|
|
66
|
-
* @param value - 布局选项
|
|
67
|
-
* @returns
|
|
68
|
-
*/
|
|
69
|
-
setTextAlign(value: spec.TextAlignment): void;
|
|
70
|
-
/**
|
|
71
|
-
* 设置文本颜色
|
|
72
|
-
* @param value - 颜色内容
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
|
-
setTextColor(value: spec.RGBAColorValue): void;
|
|
76
|
-
/**
|
|
77
|
-
* 设置外描边文本颜色
|
|
78
|
-
* @param value - 颜色内容
|
|
79
|
-
* @returns
|
|
80
|
-
*/
|
|
81
|
-
setOutlineColor(value: spec.RGBAColorValue): void;
|
|
82
|
-
/**
|
|
83
|
-
* 设置字体清晰度
|
|
84
|
-
* @param value - 字体清晰度
|
|
85
|
-
* @returns
|
|
86
|
-
*/
|
|
87
|
-
setFontScale(value: number): void;
|
|
88
56
|
/**
|
|
89
57
|
* 更新文本
|
|
90
|
-
* @returns
|
|
91
58
|
*/
|
|
92
59
|
protected updateTexture(flipY?: boolean): void;
|
|
93
60
|
renderText(options: spec.TextContentOptions): void;
|
|
@@ -119,17 +86,47 @@ export declare class TextComponent extends MaskableGraphic {
|
|
|
119
86
|
* @param value - 文本框高度
|
|
120
87
|
*/
|
|
121
88
|
setTextHeight(value: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* 设置字体大小
|
|
91
|
+
* @param value - 字体大小
|
|
92
|
+
* @default 40
|
|
93
|
+
*/
|
|
122
94
|
setFontSize(value: number): void;
|
|
95
|
+
/**
|
|
96
|
+
* 设置描边宽度
|
|
97
|
+
* @param value - 描边宽度
|
|
98
|
+
* @default 0
|
|
99
|
+
*/
|
|
123
100
|
setOutlineWidth(value: number): void;
|
|
124
101
|
/**
|
|
125
102
|
* 设置是否启用文本描边
|
|
126
103
|
* @param value - 是否启用描边
|
|
127
|
-
* @returns
|
|
128
104
|
*/
|
|
129
105
|
setOutlineEnabled(value: boolean): void;
|
|
106
|
+
/**
|
|
107
|
+
* 设置阴影模糊度
|
|
108
|
+
* @param value - 阴影模糊度
|
|
109
|
+
* @default 0
|
|
110
|
+
*/
|
|
130
111
|
setShadowBlur(value: number): void;
|
|
112
|
+
/**
|
|
113
|
+
* 设置阴影颜色
|
|
114
|
+
* > setupShadow 使用 outlineColor 作为阴影颜色,更新 shadowColor 不影响阴影颜色
|
|
115
|
+
* @param value - 阴影颜色
|
|
116
|
+
* @returns
|
|
117
|
+
*/
|
|
131
118
|
setShadowColor(value: spec.RGBAColorValue): void;
|
|
119
|
+
/**
|
|
120
|
+
* 设置阴影偏移 X
|
|
121
|
+
* @param value - 阴影偏移值
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
132
124
|
setShadowOffsetX(value: number): void;
|
|
125
|
+
/**
|
|
126
|
+
* 设置阴影偏移 Y
|
|
127
|
+
* @param value - 阴影偏移值
|
|
128
|
+
* @returns
|
|
129
|
+
*/
|
|
133
130
|
setShadowOffsetY(value: number): void;
|
|
134
131
|
/**
|
|
135
132
|
* 计算文本在当前样式与布局规则下的建议宽度(逻辑像素)。
|
|
@@ -14,12 +14,9 @@ export declare class TimelineAsset extends EffectsObject {
|
|
|
14
14
|
private addSubTracksRecursive;
|
|
15
15
|
}
|
|
16
16
|
export declare class TimelineInstance {
|
|
17
|
-
private time;
|
|
18
17
|
private clips;
|
|
19
18
|
constructor(timelineAsset: TimelineAsset, sceneBindings: SceneBinding[]);
|
|
20
|
-
|
|
21
|
-
getTime(): number;
|
|
22
|
-
evaluate(deltaTime: number): void;
|
|
19
|
+
evaluate(time: number, deltaTime: number): void;
|
|
23
20
|
compileTracks(tracks: TrackAsset[], sceneBindings: SceneBinding[]): void;
|
|
24
21
|
private tickTrack;
|
|
25
22
|
private updateTrackAnimatedObject;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Composition } from '../composition';
|
|
2
|
+
import { VFXItem } from '../vfx-item';
|
|
3
|
+
import type { Precomposition } from './precomposition';
|
|
4
|
+
export declare class PrecompositionManager {
|
|
5
|
+
/**
|
|
6
|
+
* 从预合成数据实例化一棵 VFXItem 树。
|
|
7
|
+
* 可挂载到现有合成的节点下。
|
|
8
|
+
* @param precomposition 预合成数据
|
|
9
|
+
* @param composition 目标合成
|
|
10
|
+
* @returns 实例化生成的根 VFXItem,其子树包含指定合成的所有元素
|
|
11
|
+
*/
|
|
12
|
+
static instantiate(precomposition: Precomposition, composition: Composition): VFXItem;
|
|
13
|
+
}
|
package/dist/scene-loader.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Composition } from './composition';
|
|
2
2
|
import type { Engine } from './engine';
|
|
3
3
|
import type { Scene, SceneLoadOptions } from './scene';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
4
7
|
export declare class SceneLoader {
|
|
5
8
|
static load(scene: Scene.LoadType, engine: Engine, options?: SceneLoadOptions): Promise<Composition>;
|
|
6
9
|
private static createComposition;
|
package/dist/scene.d.ts
CHANGED
package/dist/vfx-item.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
2
2
|
import * as spec from '@galacean/effects-specification';
|
|
3
3
|
import type { Component } from './components';
|
|
4
|
-
import { Composition } from './composition';
|
|
4
|
+
import type { Composition } from './composition';
|
|
5
5
|
import { EffectsObject } from './effects-object';
|
|
6
6
|
import type { Engine } from './engine';
|
|
7
7
|
import type { EventEmitterListener, EventEmitterOptions, ItemEvent } from './events';
|
|
@@ -49,10 +49,18 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
49
49
|
* @deprecated 2.7.0 Please use `getInstanceId` instead
|
|
50
50
|
*/
|
|
51
51
|
id: string;
|
|
52
|
+
/**
|
|
53
|
+
* 元素类型
|
|
54
|
+
*/
|
|
52
55
|
type: spec.ItemType;
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated 2.9.0 Please use `defination` instead
|
|
58
|
+
*/
|
|
53
59
|
props: spec.VFXItemData;
|
|
60
|
+
/**
|
|
61
|
+
* 元素绑定的组件列表
|
|
62
|
+
*/
|
|
54
63
|
components: Component[];
|
|
55
|
-
isDuringPlay: boolean;
|
|
56
64
|
/**
|
|
57
65
|
* 元素是否激活
|
|
58
66
|
*/
|
|
@@ -64,9 +72,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
64
72
|
private listIndex;
|
|
65
73
|
private isEnabled;
|
|
66
74
|
private eventProcessor;
|
|
67
|
-
/**
|
|
68
|
-
* 合成属性
|
|
69
|
-
*/
|
|
70
75
|
private _composition;
|
|
71
76
|
/**
|
|
72
77
|
*
|
|
@@ -127,6 +132,7 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
127
132
|
set composition(value: Composition);
|
|
128
133
|
/**
|
|
129
134
|
* 播放完成后是否需要再使用,是的话生命周期结束后不会 dispose
|
|
135
|
+
* @deprecated
|
|
130
136
|
*/
|
|
131
137
|
get compositionReusable(): boolean;
|
|
132
138
|
/**
|
|
@@ -287,8 +293,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
287
293
|
*/
|
|
288
294
|
dispose(): void;
|
|
289
295
|
private resetChildrenParent;
|
|
290
|
-
private instantiatePreComposition;
|
|
291
|
-
private resetGUID;
|
|
292
296
|
private gatherPreviousObjectID;
|
|
293
297
|
private getDescendantsInternal;
|
|
294
298
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-core",
|
|
3
|
-
"version": "2.9.0-alpha.
|
|
3
|
+
"version": "2.9.0-alpha.1",
|
|
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.
|
|
45
|
+
"@galacean/effects-specification": "2.8.0-alpha.0",
|
|
46
46
|
"@galacean/effects-math": "1.1.0",
|
|
47
47
|
"flatbuffers": "24.3.25",
|
|
48
48
|
"uuid": "9.0.1",
|