@galacean/effects-specification 2.2.0-alpha.4 → 2.2.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.
@@ -1,7 +1,8 @@
1
1
  import type { BinaryEnv } from '../binary';
2
+ import type { DataPath } from '../components';
2
3
  import type { Vector2Data, Vector3Data } from '../math';
3
4
  import type { vec3, vec4 } from '../number-expression';
4
- import type { ItemType, RenderLevel } from '../type';
5
+ import type { ItemType, ObscuredMode, RenderLevel } from '../type';
5
6
  import type { CameraContent } from './camera-item';
6
7
  import type { CompositionContent } from './composition-item';
7
8
  import type { EffectContent } from './effect-item';
@@ -38,6 +39,25 @@ export declare enum EndBehavior {
38
39
  export declare enum ParentItemEndBehavior {
39
40
  destroyChildren = 6
40
41
  }
42
+ /**
43
+ * 元素被遮挡/反向遮挡,需要时传入
44
+ */
45
+ export interface ObscuredOptions {
46
+ mode: ObscuredMode;
47
+ /**
48
+ * 指向作为蒙版的组件
49
+ */
50
+ ref: DataPath;
51
+ }
52
+ /**
53
+ * 元素的蒙版行为
54
+ */
55
+ export interface MaskOptions {
56
+ /**
57
+ * 是否作为蒙版
58
+ */
59
+ mask?: boolean;
60
+ }
41
61
  export interface BaseItem {
42
62
  /**
43
63
  * 元素 id
@@ -1,6 +1,6 @@
1
1
  import type { ComponentData, DataPath } from '../components';
2
2
  import type { ItemType, PositionOverLifetime, RotationOverLifetime, SizeOverLifetime } from '../type';
3
- import type { BaseItem, EndBehavior } from './base-item';
3
+ import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
4
4
  /**
5
5
  * 特效元素
6
6
  */
@@ -38,4 +38,8 @@ export interface EffectComponentData extends ComponentData {
38
38
  _priority: number;
39
39
  materials: DataPath[];
40
40
  geometry: DataPath;
41
+ /**
42
+ * 特效元素蒙版属性,传入表示需要被遮挡/反向遮挡
43
+ */
44
+ mask?: ObscuredOptions;
41
45
  }
@@ -1,6 +1,6 @@
1
1
  import type { ItemType, RendererOptions, TextureSheetAnimation, BlendingMode, SplitParameter } from '../type';
2
2
  import type { FixedNumberExpression, NumberExpression, GradientColor, vec3, FixedVec3Expression, ColorExpression, FunctionExpression } from '../number-expression';
3
- import type { BaseItem, EndBehavior } from './base-item';
3
+ import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
4
4
  import type { ParticleShape } from './particle-shape';
5
5
  import type { ComponentData, DataPath } from '../components';
6
6
  /**
@@ -277,6 +277,10 @@ export interface ParticleContent {
277
277
  * 粒子元素材质渲染属性
278
278
  */
279
279
  renderer: RendererOptions;
280
+ /**
281
+ * 粒子元素蒙版属性,传入表示需要被遮挡/反向遮挡
282
+ */
283
+ mask?: ObscuredOptions;
280
284
  /**
281
285
  * 粒子元素发射器形状属性
282
286
  */
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior } from './base-item';
1
+ import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
2
2
  import type { ItemType } from '../type';
3
3
  import type { BaseTextContentOptions, TextComponentData, TextContent } from './text-item';
4
4
  import type { vec2 } from '../number-expression';
@@ -42,4 +42,8 @@ export interface RichTextComponentData extends Omit<TextComponentData, 'options'
42
42
  * 富文本元素基础属性
43
43
  */
44
44
  options: RichTextContentOptions;
45
+ /**
46
+ * 富文本元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
47
+ */
48
+ mask?: MaskOptions;
45
49
  }
@@ -1,8 +1,8 @@
1
1
  import type { BinaryPointer } from '../binary';
2
2
  import type { ComponentData, DataPath } from '../components';
3
3
  import type { DataType } from '../data-type';
4
- import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType, MaskMode, RenderMode } from '../type';
5
- import type { BaseItem, EndBehavior } from './base-item';
4
+ import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType, RenderMode } from '../type';
5
+ import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
6
6
  /**
7
7
  * 插件元素
8
8
  */
@@ -121,6 +121,9 @@ export interface SpineComponent extends ComponentData {
121
121
  };
122
122
  renderer?: {
123
123
  renderMode: RenderMode;
124
- maskMode: MaskMode;
125
124
  };
125
+ /**
126
+ * Spine 元素蒙版属性,传入表示需要被遮挡/反向遮挡
127
+ */
128
+ mask?: ObscuredOptions;
126
129
  }
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior } from './base-item';
1
+ import type { BaseItem, EndBehavior, MaskOptions, ObscuredOptions } from './base-item';
2
2
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, ItemType, TextureSheetAnimation, RendererOptions, SplitParameter, InteractBehavior } from '../type';
3
3
  import type { RGBAColorValue } from '../number-expression';
4
4
  import type { ComponentData } from '../components';
@@ -40,6 +40,10 @@ export interface SpriteContent {
40
40
  * 图层元素材质渲染属性
41
41
  */
42
42
  renderer: RendererOptions;
43
+ /**
44
+ * 图层元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
45
+ */
46
+ mask?: MaskOptions | ObscuredOptions;
43
47
  /**
44
48
  * 图层元素大小变化属性
45
49
  */
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior } from './base-item';
1
+ import type { BaseItem, EndBehavior, MaskOptions, ObscuredOptions } from './base-item';
2
2
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, ItemType, TextureSheetAnimation, RendererOptions, InteractBehavior } from '../type';
3
3
  import type { RGBAColorValue } from '../number-expression';
4
4
  import type { FontStyle, TextAlignment, TextBaseline, TextOverflow, TextWeight } from '../text';
@@ -143,6 +143,10 @@ export interface TextContent {
143
143
  * 文本元素材质渲染属性
144
144
  */
145
145
  renderer: RendererOptions;
146
+ /**
147
+ * 文本元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
148
+ */
149
+ mask?: MaskOptions | ObscuredOptions;
146
150
  /**
147
151
  * 文本元素大小变化属性
148
152
  */
@@ -1,7 +1,7 @@
1
1
  import type { ComponentData, DataPath } from '../components';
2
2
  import type { RGBAColorValue } from '../number-expression';
3
3
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, InteractBehavior, RendererOptions, ItemType } from '../type';
4
- import type { BaseItem, EndBehavior } from './base-item';
4
+ import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
5
5
  /**
6
6
  * 视频元素
7
7
  */
@@ -59,6 +59,10 @@ export interface VideoComponentData extends ComponentData {
59
59
  * 视频元素材质渲染属性
60
60
  */
61
61
  renderer: RendererOptions;
62
+ /**
63
+ * 视频元素蒙版属性,传入表示需要被遮挡/反向遮挡
64
+ */
65
+ mask?: ObscuredOptions;
62
66
  /**
63
67
  * 视频元素大小变化属性
64
68
  */
package/es/type.d.ts CHANGED
@@ -294,17 +294,12 @@ export declare enum SideMode {
294
294
  BACK = 1029
295
295
  }
296
296
  /**
297
- * 蒙版模式
297
+ * 元素是否被蒙版遮挡/反向遮挡
298
298
  */
299
- export declare enum MaskMode {
299
+ export declare enum ObscuredMode {
300
300
  /**
301
- * 无蒙版
302
- */
303
- NONE = 0,
304
- /**
305
- * 蒙版
301
+ *
306
302
  */
307
- MASK = 1,
308
303
  /**
309
304
  * 被遮挡
310
305
  */
@@ -446,11 +441,6 @@ export interface RendererOptions {
446
441
  * 贴图,索引到 scene 中的 images 数组
447
442
  */
448
443
  texture?: DataPath;
449
- /**
450
- * 蒙版模式
451
- * @default none
452
- */
453
- maskMode?: MaskMode;
454
444
  /**
455
445
  * 蒙版形状,索引到 scene 的 shapes 中
456
446
  */
package/es/type.js CHANGED
@@ -69,27 +69,27 @@ export var SideMode;
69
69
  SideMode[SideMode["BACK"] = 1029] = "BACK";
70
70
  })(SideMode || (SideMode = {}));
71
71
  /**
72
- * 蒙版模式
72
+ * 元素是否被蒙版遮挡/反向遮挡
73
73
  */
74
- export var MaskMode;
75
- (function (MaskMode) {
74
+ export var ObscuredMode;
75
+ (function (ObscuredMode) {
76
76
  /**
77
- * 无蒙版
78
- */
79
- MaskMode[MaskMode["NONE"] = 0] = "NONE";
80
- /**
81
- * 蒙版
77
+ *
82
78
  */
83
- MaskMode[MaskMode["MASK"] = 1] = "MASK";
79
+ // NONE = 0,
80
+ // /**
81
+ // * 蒙版
82
+ // */
83
+ // MASK = 1,
84
84
  /**
85
85
  * 被遮挡
86
86
  */
87
- MaskMode[MaskMode["OBSCURED"] = 2] = "OBSCURED";
87
+ ObscuredMode[ObscuredMode["OBSCURED"] = 2] = "OBSCURED";
88
88
  /**
89
89
  * 被反向遮挡
90
90
  */
91
- MaskMode[MaskMode["REVERSE_OBSCURED"] = 3] = "REVERSE_OBSCURED";
92
- })(MaskMode || (MaskMode = {}));
91
+ ObscuredMode[ObscuredMode["REVERSE_OBSCURED"] = 3] = "REVERSE_OBSCURED";
92
+ })(ObscuredMode || (ObscuredMode = {}));
93
93
  /**
94
94
  * 发射器形状
95
95
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.2.0-alpha.4",
3
+ "version": "2.2.0-alpha.5",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",