@galacean/effects-core 2.7.0-alpha.1 → 2.7.0-beta.0

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.
@@ -354,10 +354,6 @@ export declare abstract class Material extends EffectsObject implements Disposab
354
354
  */
355
355
  abstract clone(props?: MaterialProps): Material;
356
356
  abstract cloneUniforms(sourceMaterial: Material): void;
357
- /**
358
- * 销毁当前 Material
359
- */
360
- abstract dispose(): void;
361
357
  /**
362
358
  * 创建 Material
363
359
  */
@@ -3,7 +3,8 @@ import type { Composition } from './composition';
3
3
  import type { Plugin, PluginConstructor } from './plugins';
4
4
  import type { RenderFrame, Renderer } from './render';
5
5
  import type { Scene, SceneLoadOptions } from './scene';
6
- import type { VFXItemConstructor } from './vfx-item';
6
+ import type { Constructor } from './utils';
7
+ import type { VFXItem } from './vfx-item';
7
8
  export declare const pluginLoaderMap: Record<string, PluginConstructor>;
8
9
  export declare const defaultPlugins: string[];
9
10
  /**
@@ -13,7 +14,7 @@ export declare const defaultPlugins: string[];
13
14
  * @param itemClass class of item
14
15
  * @param isDefault load
15
16
  */
16
- export declare function registerPlugin(name: string, pluginClass: PluginConstructor, itemClass: VFXItemConstructor): void;
17
+ export declare function registerPlugin(name: string, pluginClass: PluginConstructor, itemClass: Constructor<VFXItem>): void;
17
18
  export declare function unregisterPlugin(name: string): void;
18
19
  export declare class PluginSystem {
19
20
  readonly plugins: Plugin[];
@@ -1,6 +1,6 @@
1
1
  import { Quaternion } from '@galacean/effects-math/es/core/quaternion';
2
2
  import { Vector3 } from '@galacean/effects-math/es/core/vector3';
3
- import type { Color } from '@galacean/effects-math/es/core/color';
3
+ import { Color } from '@galacean/effects-math/es/core/color';
4
4
  import type { Skeleton } from './skeleton';
5
5
  import type { Transform } from '../../transform';
6
6
  export declare class NodeTransform {
@@ -1,4 +1,4 @@
1
- import type { Color } from '@galacean/effects-math/es/core/color';
1
+ import { Color } from '@galacean/effects-math/es/core/color';
2
2
  import type { VFXItem } from '../../vfx-item';
3
3
  import type { Transform } from '../../transform';
4
4
  import { NodeTransform } from './pose';
@@ -50,11 +50,32 @@ export declare class InteractComponent extends RendererComponent {
50
50
  /** 是否响应点击和拖拽交互事件 */
51
51
  private _interactive;
52
52
  private lastTime;
53
+ /**
54
+ * 是否响应点击和拖拽交互事件
55
+ */
53
56
  set interactive(enable: boolean);
54
57
  get interactive(): boolean;
58
+ /**
59
+ * 获取拖拽范围 X 轴
60
+ * @returns 拖拽范围 [min, max]
61
+ */
55
62
  getDragRangeX(): [min: number, max: number];
63
+ /**
64
+ * 设置拖拽范围 X 轴
65
+ * @param min 最小值
66
+ * @param max 最大值
67
+ */
56
68
  setDragRangeX(min: number, max: number): void;
69
+ /**
70
+ * 获取拖拽范围 Y 轴
71
+ * @returns 拖拽范围 [min, max]
72
+ */
57
73
  getDragRangeY(): [min: number, max: number];
74
+ /**
75
+ * 设置拖拽范围 Y 轴
76
+ * @param min 最小值
77
+ * @param max 最大值
78
+ */
58
79
  setDragRangeY(min: number, max: number): void;
59
80
  onStart(): void;
60
81
  onDisable(): void;
@@ -68,6 +89,10 @@ export declare class InteractComponent extends RendererComponent {
68
89
  getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
69
90
  getBoundingBox(): BoundingBoxTriangle | void;
70
91
  fromData(data: spec.InteractContent): void;
92
+ /**
93
+ * 是否可以交互
94
+ * @returns
95
+ */
71
96
  canInteract(): boolean;
72
97
  /**
73
98
  * 检查滑动手势边界
@@ -1,6 +1,5 @@
1
1
  import type * as spec from '@galacean/effects-specification';
2
2
  import type { Engine } from '../../engine';
3
- import type { MeshRendererOptions } from '../../render';
4
3
  import { Mesh } from '../../render';
5
4
  import type { Transform } from '../../transform';
6
5
  export declare class InteractMesh {
@@ -8,7 +7,7 @@ export declare class InteractMesh {
8
7
  private readonly engine;
9
8
  mesh: Mesh;
10
9
  private readonly color;
11
- constructor(props: spec.InteractContent, rendererOptions: MeshRendererOptions, transform: Transform, engine: Engine);
10
+ constructor(props: spec.InteractContent, transform: Transform, engine: Engine);
12
11
  updateMesh(): void;
13
12
  private createMaterial;
14
13
  private createGeometry;
@@ -41,7 +41,7 @@ export declare class ComponentTimePlayable extends Playable {
41
41
  export declare class SpriteComponent extends MaskableGraphic {
42
42
  time: number;
43
43
  duration: number;
44
- frameAnimationLoop: boolean;
44
+ loop: boolean;
45
45
  protected textureSheetAnimation?: spec.TextureSheetAnimation;
46
46
  constructor(engine: Engine, props?: spec.SpriteComponentData);
47
47
  onUpdate(dt: number): void;
@@ -26,6 +26,7 @@ export declare class TextComponent extends MaskableGraphic {
26
26
  protected readonly ALPHA_FIX_VALUE: number;
27
27
  constructor(engine: Engine, props?: spec.TextComponentData);
28
28
  onUpdate(dt: number): void;
29
+ onDestroy(): void;
29
30
  fromData(data: spec.TextComponentData): void;
30
31
  updateWithOptions(options: spec.TextContentOptions): void;
31
32
  updateTexture(flipY?: boolean): void;
@@ -161,6 +162,7 @@ export declare class TextComponentBase {
161
162
  * @returns
162
163
  */
163
164
  updateTexture(flipY?: boolean): void;
165
+ protected disposeTextTexture(): void;
164
166
  private getFontDesc;
165
167
  private setupOutline;
166
168
  private setupShadow;
@@ -6,6 +6,10 @@ export declare class TextLayout {
6
6
  letterSpace: number;
7
7
  lineGap: number;
8
8
  overflow: spec.TextOverflow;
9
+ /**
10
+ * 兼容旧版富文本的排版方式
11
+ */
12
+ useLegacyRichText: boolean;
9
13
  width: number;
10
14
  height: number;
11
15
  /**
@@ -28,6 +32,14 @@ export declare class TextLayout {
28
32
  */
29
33
  getOffsetY(style: TextStyle, lineCount: number, lineHeight: number, fontSize: number): number;
30
34
  getOffsetX(style: TextStyle, maxWidth: number): number;
35
+ /**
36
+ * 富文本垂直对齐计算
37
+ * @param style - 字体样式
38
+ * @param lineHeights - 每行高度数组
39
+ * @param fontSize - 字体大小
40
+ * @returns 第一行基线的 Y 坐标
41
+ */
42
+ getOffsetYRich(style: TextStyle, lineHeights: number[], fontSize: number): number;
31
43
  /**
32
44
  * 设置文本框的宽度和高度
33
45
  * @param width 文本框宽度
@@ -5,7 +5,6 @@ export * from './render-pass';
5
5
  export * from './shader';
6
6
  export * from './gpu-capability';
7
7
  export * from './mesh';
8
- export * from './types';
9
8
  export * from './geometry';
10
9
  export * from './framebuffer';
11
10
  export * from './renderer';
@@ -185,14 +185,6 @@ export declare class RenderFrame implements Disposable {
185
185
  */
186
186
  readonly semantics: SemanticMap;
187
187
  readonly globalUniforms: GlobalUniforms;
188
- /**
189
- * 空纹理,大小1x1,白色
190
- */
191
- readonly emptyTexture: Texture;
192
- /**
193
- * 空纹理,大小1x1,透明
194
- */
195
- readonly transparentTexture: Texture;
196
188
  protected destroyed: boolean;
197
189
  protected renderPassInfoMap: WeakMap<RenderPass, RenderPassInfo>;
198
190
  private drawObjectPass;
@@ -79,10 +79,6 @@ export declare abstract class Texture extends EffectsObject {
79
79
  * @param options - 创建 Texture 选项
80
80
  */
81
81
  abstract updateSource(options: TextureSourceOptions): void;
82
- /**
83
- * 销毁当前资源。
84
- */
85
- abstract dispose(): void;
86
82
  /**
87
83
  * 初始化 GPU 资源
88
84
  * @override
@@ -5,22 +5,20 @@ import { 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';
8
- import type { BoundingBoxData, CameraController, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, HitTestTriangleParams, InteractComponent, SpriteComponent } from './plugins';
9
- import { ParticleSystem } from './plugins';
8
+ import type { BoundingBoxData, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, HitTestTriangleParams } from './plugins';
10
9
  import { Transform } from './transform';
11
10
  import type { Constructor, Disposable } from './utils';
12
- export type VFXItemContent = ParticleSystem | SpriteComponent | CameraController | InteractComponent | undefined | {};
13
- export type VFXItemConstructor = new (engine: Engine, props: spec.Item, composition: Composition) => VFXItem;
14
11
  /**
15
- * 所有元素的继承的抽象类
12
+ * VFX 元素,包含元素的变换、组件、子元素等信息。
16
13
  */
17
14
  export declare class VFXItem extends EffectsObject implements Disposable {
18
15
  /**
19
- * 元素绑定的父元素,
20
- * 1. 当元素没有绑定任何父元素时,parent为空,transform.parentTransform 为 composition.transform
21
- * 2. 当元素绑定 nullItem 时,parent 为 nullItem, transform.parentTransform 为 nullItem.transform
16
+ * 元素绑定的父元素
22
17
  */
23
18
  parent?: VFXItem;
19
+ /**
20
+ * 元素的子元素列表
21
+ */
24
22
  children: VFXItem[];
25
23
  /**
26
24
  * 元素的变换包含位置、旋转、缩放。
@@ -38,10 +36,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
38
36
  * 父元素的 id
39
37
  */
40
38
  parentId?: string;
41
- /**
42
- * 元素动画的开始时间
43
- */
44
- start: number;
45
39
  /**
46
40
  * 元素动画结束时行为(如何处理元素)
47
41
  */
@@ -52,12 +46,9 @@ export declare class VFXItem extends EffectsObject implements Disposable {
52
46
  name: string;
53
47
  /**
54
48
  * 元素 id 唯一
49
+ * @deprecated 2.7.0 Please use `getInstanceId` instead
55
50
  */
56
51
  id: string;
57
- /**
58
- * 元素创建的数据图层/粒子/模型等
59
- */
60
- _content?: VFXItemContent;
61
52
  type: spec.ItemType;
62
53
  props: spec.VFXItemData;
63
54
  components: Component[];
@@ -126,10 +117,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
126
117
  * @param props
127
118
  */
128
119
  constructor(engine: Engine, props?: spec.Item);
129
- /**
130
- * 返回元素创建的数据
131
- */
132
- get content(): VFXItemContent;
133
120
  /**
134
121
  * 获取元素的合成
135
122
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-core",
3
- "version": "2.7.0-alpha.1",
3
+ "version": "2.7.0-beta.0",
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.6.0-alpha.1",
45
+ "@galacean/effects-specification": "2.6.0",
46
46
  "@galacean/effects-math": "1.1.0",
47
47
  "flatbuffers": "24.3.25",
48
48
  "uuid": "9.0.1",
@@ -1,5 +0,0 @@
1
- import type { Texture } from '../texture';
2
- export interface MeshRendererOptions {
3
- emptyTexture: Texture;
4
- cachePrefix: string;
5
- }