@galacean/effects-specification 2.2.0-alpha.6 → 2.2.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.
@@ -1,8 +1,7 @@
1
1
  import type { BinaryEnv } from '../binary';
2
- import type { DataPath } from '../components';
3
2
  import type { Vector2Data, Vector3Data } from '../math';
4
3
  import type { vec3, vec4 } from '../number-expression';
5
- import type { ItemType, ObscuredMode, RenderLevel } from '../type';
4
+ import type { ItemType, RenderLevel } from '../type';
6
5
  import type { CameraContent } from './camera-item';
7
6
  import type { CompositionContent } from './composition-item';
8
7
  import type { EffectContent } from './effect-item';
@@ -39,25 +38,6 @@ export declare enum EndBehavior {
39
38
  export declare enum ParentItemEndBehavior {
40
39
  destroyChildren = 6
41
40
  }
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
- }
61
41
  export interface BaseItem {
62
42
  /**
63
43
  * 元素 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, ObscuredOptions } from './base-item';
3
+ import type { BaseItem, EndBehavior } from './base-item';
4
4
  /**
5
5
  * 特效元素
6
6
  */
@@ -38,8 +38,4 @@ export interface EffectComponentData extends ComponentData {
38
38
  _priority: number;
39
39
  materials: DataPath[];
40
40
  geometry: DataPath;
41
- /**
42
- * 特效元素蒙版属性,传入表示需要被遮挡/反向遮挡
43
- */
44
- mask?: ObscuredOptions;
45
41
  }
@@ -1,6 +1,6 @@
1
- import type { ItemType, RendererOptions, TextureSheetAnimation, BlendingMode, SplitParameter, ObscuredMode } from '../type';
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, ObscuredOptions } from './base-item';
3
+ import type { BaseItem, EndBehavior } from './base-item';
4
4
  import type { ParticleShape } from './particle-shape';
5
5
  import type { ComponentData, DataPath } from '../components';
6
6
  /**
@@ -277,10 +277,6 @@ export interface ParticleContent {
277
277
  * 粒子元素材质渲染属性
278
278
  */
279
279
  renderer: RendererOptions;
280
- /**
281
- * 粒子元素蒙版属性,传入表示需要被遮挡/反向遮挡
282
- */
283
- mask?: ObscuredOptions;
284
280
  /**
285
281
  * 粒子元素发射器形状属性
286
282
  */
@@ -417,8 +413,4 @@ export interface ParticleTrail {
417
413
  * 拖尾+图层绑定同一个父节点时使用
418
414
  */
419
415
  parentAffectsPosition?: boolean;
420
- /**
421
- * 拖尾蒙版属性,传入表示需要被遮挡/反向遮挡
422
- */
423
- mask?: ObscuredMode;
424
416
  }
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
1
+ import type { BaseItem, EndBehavior } 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,8 +42,4 @@ export interface RichTextComponentData extends Omit<TextComponentData, 'options'
42
42
  * 富文本元素基础属性
43
43
  */
44
44
  options: RichTextContentOptions;
45
- /**
46
- * 富文本元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
47
- */
48
- mask?: MaskOptions;
49
45
  }
@@ -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, RenderMode } from '../type';
5
- import type { BaseItem, EndBehavior, ObscuredOptions } from './base-item';
4
+ import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType, MaskMode, RenderMode } from '../type';
5
+ import type { BaseItem, EndBehavior } from './base-item';
6
6
  /**
7
7
  * 插件元素
8
8
  */
@@ -121,9 +121,6 @@ export interface SpineComponent extends ComponentData {
121
121
  };
122
122
  renderer?: {
123
123
  renderMode: RenderMode;
124
+ maskMode: MaskMode;
124
125
  };
125
- /**
126
- * Spine 元素蒙版属性,传入表示需要被遮挡/反向遮挡
127
- */
128
- mask?: ObscuredOptions;
129
126
  }
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior, MaskOptions, ObscuredOptions } from './base-item';
1
+ import type { BaseItem, EndBehavior } 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,10 +40,6 @@ export interface SpriteContent {
40
40
  * 图层元素材质渲染属性
41
41
  */
42
42
  renderer: RendererOptions;
43
- /**
44
- * 图层元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
45
- */
46
- mask?: MaskOptions | ObscuredOptions;
47
43
  /**
48
44
  * 图层元素大小变化属性
49
45
  */
@@ -1,4 +1,4 @@
1
- import type { BaseItem, EndBehavior, MaskOptions, ObscuredOptions } from './base-item';
1
+ import type { BaseItem, EndBehavior } 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,10 +143,6 @@ export interface TextContent {
143
143
  * 文本元素材质渲染属性
144
144
  */
145
145
  renderer: RendererOptions;
146
- /**
147
- * 文本元素蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
148
- */
149
- mask?: MaskOptions | ObscuredOptions;
150
146
  /**
151
147
  * 文本元素大小变化属性
152
148
  */
@@ -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, ObscuredOptions } from './base-item';
4
+ import type { BaseItem, EndBehavior } from './base-item';
5
5
  /**
6
6
  * 视频元素
7
7
  */
@@ -59,10 +59,6 @@ export interface VideoComponentData extends ComponentData {
59
59
  * 视频元素材质渲染属性
60
60
  */
61
61
  renderer: RendererOptions;
62
- /**
63
- * 视频元素蒙版属性,传入表示需要被遮挡/反向遮挡
64
- */
65
- mask?: ObscuredOptions;
66
62
  /**
67
63
  * 视频元素大小变化属性
68
64
  */
@@ -1,5 +1,4 @@
1
1
  import type { ComponentData } from '../components/component-data';
2
- import type { MaskOptions, ObscuredOptions } from '../item/base-item';
3
2
  import type { ShapeFillParam } from './shape-fill-param';
4
3
  import type { ShapePrimitiveType } from './shape-primitive-type';
5
4
  import type { ShapeStrokeParam } from './shape-stroke-param';
@@ -19,8 +18,4 @@ export interface ShapeComponentData extends ComponentData {
19
18
  * 填充属性
20
19
  */
21
20
  fill?: ShapeFillParam;
22
- /**
23
- * 蒙版属性,传入表示需要作为蒙版/被遮挡/反向遮挡
24
- */
25
- mask?: MaskOptions | ObscuredOptions;
26
21
  }
package/es/type.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import type { DataPath } from './components';
2
- import type { ObscuredOptions, MaskOptions } from './item/base-item';
3
2
  import type { FixedVec3Expression, vec2, vec3, GradientColor, ShapePoints, ShapeSplits, FixedNumberExpression } from './number-expression';
4
3
  /**
5
4
  * 播放器版本
@@ -295,12 +294,17 @@ export declare enum SideMode {
295
294
  BACK = 1029
296
295
  }
297
296
  /**
298
- * 元素是否被蒙版遮挡/反向遮挡
297
+ * 蒙版模式
299
298
  */
300
- export declare enum ObscuredMode {
299
+ export declare enum MaskMode {
301
300
  /**
302
- *
301
+ * 无蒙版
302
+ */
303
+ NONE = 0,
304
+ /**
305
+ * 蒙版
303
306
  */
307
+ MASK = 1,
304
308
  /**
305
309
  * 被遮挡
306
310
  */
@@ -442,6 +446,11 @@ export interface RendererOptions {
442
446
  * 贴图,索引到 scene 中的 images 数组
443
447
  */
444
448
  texture?: DataPath;
449
+ /**
450
+ * 蒙版模式
451
+ * @default none
452
+ */
453
+ maskMode?: MaskMode;
445
454
  /**
446
455
  * 蒙版形状,索引到 scene 的 shapes 中
447
456
  */
@@ -454,10 +463,6 @@ export interface RendererOptions {
454
463
  * 锚点
455
464
  */
456
465
  anchor?: vec2;
457
- /**
458
- * 蒙版属性
459
- */
460
- mask?: MaskOptions | ObscuredOptions;
461
466
  }
462
467
  /**
463
468
  * 元素类型
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 ObscuredMode;
75
- (function (ObscuredMode) {
74
+ export var MaskMode;
75
+ (function (MaskMode) {
76
76
  /**
77
- *
77
+ * 无蒙版
78
+ */
79
+ MaskMode[MaskMode["NONE"] = 0] = "NONE";
80
+ /**
81
+ * 蒙版
78
82
  */
79
- // NONE = 0,
80
- // /**
81
- // * 蒙版
82
- // */
83
- // MASK = 1,
83
+ MaskMode[MaskMode["MASK"] = 1] = "MASK";
84
84
  /**
85
85
  * 被遮挡
86
86
  */
87
- ObscuredMode[ObscuredMode["OBSCURED"] = 2] = "OBSCURED";
87
+ MaskMode[MaskMode["OBSCURED"] = 2] = "OBSCURED";
88
88
  /**
89
89
  * 被反向遮挡
90
90
  */
91
- ObscuredMode[ObscuredMode["REVERSE_OBSCURED"] = 3] = "REVERSE_OBSCURED";
92
- })(ObscuredMode || (ObscuredMode = {}));
91
+ MaskMode[MaskMode["REVERSE_OBSCURED"] = 3] = "REVERSE_OBSCURED";
92
+ })(MaskMode || (MaskMode = {}));
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.6",
3
+ "version": "2.2.0",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",