@galacean/effects-specification 2.0.0-alpha.8 → 2.0.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.
Files changed (101) hide show
  1. package/README.md +2 -10
  2. package/es/animation-clip-data.d.ts +26 -0
  3. package/es/animation-clip-data.js +1 -0
  4. package/{dist/src → es}/binary.d.ts +4 -2
  5. package/es/binary.js +1 -0
  6. package/es/buitin-object-guid.d.ts +5 -0
  7. package/es/buitin-object-guid.js +5 -0
  8. package/{dist/src → es}/components.d.ts +81 -4
  9. package/es/components.js +129 -0
  10. package/{dist/src → es}/composition.d.ts +28 -70
  11. package/es/composition.js +12 -0
  12. package/{dist/src → es}/constants.d.ts +23 -0
  13. package/es/constants.js +34 -0
  14. package/{dist/src → es}/image.d.ts +13 -6
  15. package/es/image.js +9 -0
  16. package/{dist/src → es}/index.d.ts +2 -1
  17. package/es/index.js +28 -0
  18. package/{dist/src → es}/item/base-item.d.ts +27 -7
  19. package/es/item/base-item.js +27 -0
  20. package/{dist/src → es}/item/camera-item.d.ts +5 -5
  21. package/es/item/camera-item.js +1 -0
  22. package/{dist/src → es}/item/composition-item.d.ts +4 -4
  23. package/es/item/composition-item.js +1 -0
  24. package/{dist/src → es}/item/effect-item.d.ts +2 -2
  25. package/es/item/effect-item.js +1 -0
  26. package/{dist/src → es}/item/interact-item.d.ts +3 -3
  27. package/es/item/interact-item.js +1 -0
  28. package/es/item/model/binary.js +1 -0
  29. package/{dist/src → es}/item/model/camera.d.ts +2 -2
  30. package/es/item/model/camera.js +5 -0
  31. package/es/item/model/index.js +35 -0
  32. package/{dist/src → es}/item/model/light.d.ts +2 -2
  33. package/es/item/model/light.js +19 -0
  34. package/{dist/src → es}/item/model/material.d.ts +3 -3
  35. package/es/item/model/material.js +16 -0
  36. package/{dist/src → es}/item/model/mesh.d.ts +6 -5
  37. package/es/item/model/mesh.js +5 -0
  38. package/es/item/model/render.js +42 -0
  39. package/{dist/src → es}/item/model/skybox.d.ts +9 -3
  40. package/es/item/model/skybox.js +1 -0
  41. package/{dist/src → es}/item/model/tree.d.ts +10 -0
  42. package/es/item/model/tree.js +1 -0
  43. package/es/item/null-item.d.ts +46 -0
  44. package/es/item/null-item.js +1 -0
  45. package/{dist/src → es}/item/particle-item.d.ts +20 -20
  46. package/es/item/particle-item.js +14 -0
  47. package/es/item/particle-shape.js +19 -0
  48. package/{dist/src → es}/item/plugin-item.d.ts +3 -3
  49. package/es/item/plugin-item.js +1 -0
  50. package/{dist/src → es}/item/spine-item.d.ts +44 -20
  51. package/es/item/spine-item.js +1 -0
  52. package/{dist/src → es}/item/sprite-item.d.ts +3 -3
  53. package/es/item/sprite-item.js +1 -0
  54. package/{dist/src → es}/item/text-item.d.ts +3 -3
  55. package/es/item/text-item.js +1 -0
  56. package/{dist/src → es}/item.d.ts +1 -3
  57. package/es/item.js +1 -0
  58. package/{dist/src → es}/number-expression.d.ts +21 -8
  59. package/es/number-expression.js +91 -0
  60. package/{dist/src → es}/scene.d.ts +17 -14
  61. package/es/scene.js +1 -0
  62. package/{dist/src → es}/text.d.ts +3 -49
  63. package/es/text.js +84 -0
  64. package/es/timeline/index.d.ts +5 -0
  65. package/es/timeline/index.js +5 -0
  66. package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +8 -0
  67. package/es/timeline/playables/sprite-color-playable-asset-data.js +1 -0
  68. package/es/timeline/playables/transform-playable-asset-data.d.ts +17 -0
  69. package/es/timeline/playables/transform-playable-asset-data.js +1 -0
  70. package/es/timeline/timeline-asset-data.d.ts +8 -0
  71. package/es/timeline/timeline-asset-data.js +1 -0
  72. package/es/timeline/timeline-clip-data.d.ts +11 -0
  73. package/es/timeline/timeline-clip-data.js +1 -0
  74. package/es/timeline/track/track-asset-data.d.ts +9 -0
  75. package/es/timeline/track/track-asset-data.js +1 -0
  76. package/{dist/src → es}/type.d.ts +25 -12
  77. package/es/type.js +342 -0
  78. package/{dist/src → es}/vfx-item-data.d.ts +8 -9
  79. package/es/vfx-item-data.js +1 -0
  80. package/package.json +27 -48
  81. package/dist/fallback/camera.d.ts +0 -2
  82. package/dist/fallback/index.d.ts +0 -12
  83. package/dist/fallback/interact.d.ts +0 -2
  84. package/dist/fallback/migration.d.ts +0 -13
  85. package/dist/fallback/particle.d.ts +0 -2
  86. package/dist/fallback/sprite.d.ts +0 -3
  87. package/dist/fallback/utils.d.ts +0 -36
  88. package/dist/fallback.js +0 -2093
  89. package/dist/fallback.js.map +0 -1
  90. package/dist/fallback.mjs +0 -2065
  91. package/dist/fallback.mjs.map +0 -1
  92. package/dist/index.js +0 -802
  93. package/dist/index.js.map +0 -1
  94. package/dist/index.mjs +0 -787
  95. package/dist/index.mjs.map +0 -1
  96. package/dist/src/buitin-object-guid.d.ts +0 -5
  97. package/dist/src/item/null-item.d.ts +0 -94
  98. /package/{dist/src → es}/item/model/binary.d.ts +0 -0
  99. /package/{dist/src → es}/item/model/index.d.ts +0 -0
  100. /package/{dist/src → es}/item/model/render.d.ts +0 -0
  101. /package/{dist/src → es}/item/particle-shape.d.ts +0 -0
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 粒子交互行为
3
+ */
4
+ export var ParticleInteractionBehavior;
5
+ (function (ParticleInteractionBehavior) {
6
+ /**
7
+ * 无
8
+ */
9
+ ParticleInteractionBehavior[ParticleInteractionBehavior["none"] = 0] = "none";
10
+ /**
11
+ * 移出粒子
12
+ */
13
+ ParticleInteractionBehavior[ParticleInteractionBehavior["removeParticle"] = 1] = "removeParticle";
14
+ })(ParticleInteractionBehavior || (ParticleInteractionBehavior = {}));
@@ -0,0 +1,19 @@
1
+ export var ShapeArcMode;
2
+ (function (ShapeArcMode) {
3
+ /**
4
+ * 随机
5
+ */
6
+ ShapeArcMode[ShapeArcMode["RANDOM"] = 0] = "RANDOM";
7
+ /**
8
+ * 单向循环
9
+ */
10
+ ShapeArcMode[ShapeArcMode["UNIDIRECTIONAL_CYCLE"] = 1] = "UNIDIRECTIONAL_CYCLE";
11
+ /**
12
+ * 双向循环
13
+ */
14
+ ShapeArcMode[ShapeArcMode["BIDIRECTIONAL_CYCLE"] = 2] = "BIDIRECTIONAL_CYCLE";
15
+ /**
16
+ * 均匀爆发
17
+ */
18
+ ShapeArcMode[ShapeArcMode["UNIFORM_BURST"] = 3] = "UNIFORM_BURST";
19
+ })(ShapeArcMode || (ShapeArcMode = {}));
@@ -1,18 +1,18 @@
1
1
  import type { ItemType, PluginGyroscopeTarget, PluginType, RendererOptions } from '../type';
2
- import type { BaseItem, ItemEndBehavior } from './base-item';
2
+ import type { BaseItem, EndBehavior } from './base-item';
3
3
  /**
4
4
  * 插件元素
5
5
  */
6
6
  export interface PluginItem extends BaseItem {
7
7
  /**
8
- * 元素类型[指定为plugin]
8
+ * 元素类型(指定为 plugin
9
9
  */
10
10
  type: ItemType.plugin;
11
11
  /**
12
12
  * 插件元素渲染信息
13
13
  */
14
14
  content: PluginContent;
15
- endBehavior: ItemEndBehavior;
15
+ endBehavior: EndBehavior;
16
16
  }
17
17
  /**
18
18
  * 插件元素渲染属性
@@ -0,0 +1 @@
1
+ export {};
@@ -1,19 +1,20 @@
1
1
  import type { BinaryPointer } from '../binary';
2
+ import type { ComponentData, DataPath, DataType } from '../components';
2
3
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType } from '../type';
3
- import type { BaseItem, ItemEndBehavior } from './base-item';
4
+ import type { BaseItem, EndBehavior } from './base-item';
4
5
  /**
5
6
  * 插件元素
6
7
  */
7
8
  export interface SpineItem extends BaseItem {
8
9
  /**
9
- * 元素类型 "spine"
10
- */
10
+ * 元素类型 "spine"
11
+ */
11
12
  type: ItemType.spine;
12
13
  /**
13
- * 插件元素渲染信息
14
- */
14
+ * 插件元素渲染信息
15
+ */
15
16
  content: SpineContent;
16
- endBehavior: ItemEndBehavior;
17
+ endBehavior: EndBehavior;
17
18
  }
18
19
  /**
19
20
  * Spine元素渲染属性
@@ -49,16 +50,16 @@ export interface SpineContent {
49
50
  */
50
51
  export interface PluginSpineOption {
51
52
  /**
52
- * 当前使用的皮肤名称
53
- */
53
+ * 当前使用的皮肤名称
54
+ */
54
55
  activeSkin: string;
55
56
  /**
56
- * 当前使用的动画列表,1.5之前为 string
57
- */
57
+ * 当前使用的动画列表,1.5 之前为 string
58
+ */
58
59
  activeAnimation: string[] | string;
59
60
  /**
60
- * 在 spines 资源数组中的索引
61
- */
61
+ * 在 spines 资源数组中的索引
62
+ */
62
63
  spine: number;
63
64
  /**
64
65
  * 默认融合时间
@@ -68,6 +69,13 @@ export interface PluginSpineOption {
68
69
  * 动画播放的速度
69
70
  */
70
71
  speed?: number;
72
+ /**
73
+ * 使用的默认大小计算规则
74
+ * 0 :除以包围盒大小
75
+ * 1 : 相机逆投影 + 固定画布大小
76
+ * @since 1.3.0
77
+ */
78
+ resizeRule: number;
71
79
  }
72
80
  /**
73
81
  * spine资源信息
@@ -75,19 +83,35 @@ export interface PluginSpineOption {
75
83
  export type skeletonFileType = 'json' | 'skel';
76
84
  export interface SpineResource {
77
85
  /**
78
- * atlas 文件在 `bins` 中的指针
79
- */
86
+ * atlas 文件在 `bins` 中的指针
87
+ */
80
88
  atlas: BinaryPointer;
81
89
  /**
82
- * 骨骼文件
83
- */
90
+ * 骨骼文件
91
+ */
84
92
  skeleton: BinaryPointer;
85
93
  /**
86
- * skeleton 文件类型, `.skel/.json`
87
- */
94
+ * skeleton 文件类型, `.skel/.json`
95
+ */
88
96
  skeletonType: skeletonFileType;
89
97
  /**
90
- * 图像文件在 `scene.textures` 数组中的索引
91
- */
98
+ * 图像文件在 `scene.textures` 数组中的索引
99
+ */
92
100
  images: number[];
93
101
  }
102
+ export interface SpineComponent extends ComponentData {
103
+ dataType: DataType.SpineComponent;
104
+ options: PluginSpineOption;
105
+ resource: {
106
+ atlas: {
107
+ bins: DataPath;
108
+ source: [start: number, length?: number];
109
+ };
110
+ skeleton: {
111
+ bins: DataPath;
112
+ source: [start: number, length?: number];
113
+ };
114
+ images: DataPath[];
115
+ skeletonType: skeletonFileType;
116
+ };
117
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import type { BaseItem, ItemEndBehavior } 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';
@@ -7,14 +7,14 @@ import type { ComponentData } from '../components';
7
7
  */
8
8
  export interface SpriteItem extends BaseItem {
9
9
  /**
10
- * 元素类型[指定为sprite]
10
+ * 元素类型(指定为 sprite
11
11
  */
12
12
  type: ItemType.sprite;
13
13
  /**
14
14
  * 图层元素渲染信息
15
15
  */
16
16
  content: SpriteContent;
17
- endBehavior: ItemEndBehavior;
17
+ endBehavior: EndBehavior;
18
18
  }
19
19
  export interface SpriteContentOptions {
20
20
  /**
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import type { BaseItem, ItemEndBehavior } 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';
@@ -8,14 +8,14 @@ import type { ComponentData } from '../components';
8
8
  */
9
9
  export interface TextItem extends BaseItem {
10
10
  /**
11
- * 元素类型[指定为text]
11
+ * 元素类型(指定为 text
12
12
  */
13
13
  type: ItemType.text;
14
14
  /**
15
15
  * 文本元素渲染信息
16
16
  */
17
17
  content: TextContent;
18
- endBehavior: ItemEndBehavior;
18
+ endBehavior: EndBehavior;
19
19
  }
20
20
  export interface TextContentOptions {
21
21
  /**
@@ -0,0 +1 @@
1
+ export {};
@@ -9,8 +9,6 @@ import type { CameraItem } from './item/camera-item';
9
9
  import type { CompositionItem } from './item/composition-item';
10
10
  import type { TextItem } from './item/text-item';
11
11
  /**
12
- * Item Interface,
13
- * 1.0版本
14
- * 基类,无对应元素
12
+ * Item 基类,无对应元素
15
13
  */
16
14
  export type Item = SpriteItem | ParticleItem | NullItem | PluginItem | InteractItem | CameraItem | TextItem | ModelMeshItem<'json'> | ModelSkyboxItem<'json'> | ModelTreeItem<'json'> | ModelLightItem | ModelCameraItem | SpineItem | CompositionItem | ModelMeshItem<'studio'> | ModelSkyboxItem<'studio'> | ModelTreeItem<'studio'>;
package/es/item.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -50,7 +50,7 @@ export declare enum ValueType {
50
50
  */
51
51
  SHAPE_SPLITS = 11,
52
52
  /**
53
- *直线路径
53
+ * 直线路径
54
54
  */
55
55
  LINEAR_PATH = 12,
56
56
  /**
@@ -68,7 +68,11 @@ export declare enum ValueType {
68
68
  /**
69
69
  * 贝塞尔曲线路径
70
70
  */
71
- BEZIER_CURVE_PATH = 22
71
+ BEZIER_CURVE_PATH = 22,
72
+ /**
73
+ * 贝塞尔曲线四元数
74
+ */
75
+ BEZIER_CURVE_QUAT = 23
72
76
  }
73
77
  export type vec2 = [x: number, y: number];
74
78
  export type vec3 = [x: number, y: number, z: number];
@@ -109,6 +113,7 @@ export type FunctionExpression = LineValue | CurveValue | BezierValue;
109
113
  export type FixedNumberExpression = ConstantNumber | LineValue | CurveValue | BezierValue;
110
114
  export type NumberExpression = FixedNumberExpression | RandomValue;
111
115
  export type FixedVec3Expression = ConstantVec3 | BezierPath | LinearPath | BezierCurvePath;
116
+ export type FixedQuatExpression = BezierCurveQuat;
112
117
  /**
113
118
  * 常数数值
114
119
  * [0,5]
@@ -150,12 +155,12 @@ export type LinearPathValue = [
150
155
  * 关键帧类型
151
156
  */
152
157
  export declare enum BezierKeyframeType {
153
- AUTO = 0,
154
- EASE = 1,
155
- EASE_IN = 2,
156
- EASE_OUT = 3,
157
- LINE = 4,
158
- HOLD = 5,
158
+ AUTO = 0,// 自动
159
+ EASE = 1,// 缓动
160
+ EASE_IN = 2,// 缓入
161
+ EASE_OUT = 3,// 缓出
162
+ LINE = 4,// 线性 (默认进)
163
+ HOLD = 5,// 定格
159
164
  LINE_OUT = 6
160
165
  }
161
166
  /**
@@ -246,10 +251,18 @@ export type BezierValue = [type: ValueType.BEZIER_CURVE, value: BezierKeyframeVa
246
251
  * 贝塞尔曲线路径关键帧值
247
252
  */
248
253
  export type BezierCurvePathValue = [easing: BezierKeyframeValue[], points: vec3[], controlePoints: vec3[]];
254
+ /**
255
+ * 贝塞尔曲线路径关键帧值
256
+ */
257
+ export type BezierCurveQuatValue = [easing: BezierKeyframeValue[], points: vec4[], controlePoints: vec4[]];
249
258
  /**
250
259
  * 贝塞尔曲线路径关键帧
251
260
  */
252
261
  export type BezierCurvePath = [type: ValueType.BEZIER_CURVE_PATH, value: BezierCurvePathValue];
262
+ /**
263
+ * 贝塞尔曲线路径关键帧
264
+ */
265
+ export type BezierCurveQuat = [type: ValueType.BEZIER_CURVE_QUAT, value: BezierCurveQuatValue];
253
266
  /*********************************************/
254
267
  /*********************************************/
255
268
  export type ColorExpression = RGBAColor | GradientColor | RGBAColors;
@@ -0,0 +1,91 @@
1
+ /*********************************************/
2
+ /* 基本数值属性参数 */
3
+ /*********************************************/
4
+ export var ValueType;
5
+ (function (ValueType) {
6
+ /**
7
+ * 常数
8
+ */
9
+ ValueType[ValueType["CONSTANT"] = 0] = "CONSTANT";
10
+ /**
11
+ * 二维常数向量
12
+ */
13
+ ValueType[ValueType["CONSTANT_VEC2"] = 1] = "CONSTANT_VEC2";
14
+ /**
15
+ * 三维常数向量
16
+ */
17
+ ValueType[ValueType["CONSTANT_VEC3"] = 2] = "CONSTANT_VEC3";
18
+ /**
19
+ * 四维常数向量
20
+ */
21
+ ValueType[ValueType["CONSTANT_VEC4"] = 3] = "CONSTANT_VEC4";
22
+ /**
23
+ * 随机数
24
+ */
25
+ ValueType[ValueType["RANDOM"] = 4] = "RANDOM";
26
+ /**
27
+ * 直线
28
+ */
29
+ ValueType[ValueType["LINE"] = 5] = "LINE";
30
+ /**
31
+ * 曲线
32
+ */
33
+ ValueType[ValueType["CURVE"] = 6] = "CURVE";
34
+ /**
35
+ * 贝塞尔路径
36
+ */
37
+ ValueType[ValueType["BEZIER_PATH"] = 7] = "BEZIER_PATH";
38
+ /**
39
+ * 颜色
40
+ */
41
+ ValueType[ValueType["RGBA_COLOR"] = 8] = "RGBA_COLOR";
42
+ /**
43
+ * 渐变色
44
+ */
45
+ ValueType[ValueType["GRADIENT_COLOR"] = 9] = "GRADIENT_COLOR";
46
+ /**
47
+ * 蒙版形状点集
48
+ */
49
+ ValueType[ValueType["SHAPE_POINTS"] = 10] = "SHAPE_POINTS";
50
+ /**
51
+ * 蒙版形状切分
52
+ */
53
+ ValueType[ValueType["SHAPE_SPLITS"] = 11] = "SHAPE_SPLITS";
54
+ /**
55
+ * 直线路径
56
+ */
57
+ ValueType[ValueType["LINEAR_PATH"] = 12] = "LINEAR_PATH";
58
+ /**
59
+ * 多色
60
+ */
61
+ ValueType[ValueType["COLORS"] = 13] = "COLORS";
62
+ /**
63
+ * 二进制指针
64
+ */
65
+ ValueType[ValueType["BINARY"] = 20] = "BINARY";
66
+ /**
67
+ * 贝塞尔曲线
68
+ */
69
+ ValueType[ValueType["BEZIER_CURVE"] = 21] = "BEZIER_CURVE";
70
+ /**
71
+ * 贝塞尔曲线路径
72
+ */
73
+ ValueType[ValueType["BEZIER_CURVE_PATH"] = 22] = "BEZIER_CURVE_PATH";
74
+ /**
75
+ * 贝塞尔曲线四元数
76
+ */
77
+ ValueType[ValueType["BEZIER_CURVE_QUAT"] = 23] = "BEZIER_CURVE_QUAT";
78
+ })(ValueType || (ValueType = {}));
79
+ /**
80
+ * 关键帧类型
81
+ */
82
+ export var BezierKeyframeType;
83
+ (function (BezierKeyframeType) {
84
+ BezierKeyframeType[BezierKeyframeType["AUTO"] = 0] = "AUTO";
85
+ BezierKeyframeType[BezierKeyframeType["EASE"] = 1] = "EASE";
86
+ BezierKeyframeType[BezierKeyframeType["EASE_IN"] = 2] = "EASE_IN";
87
+ BezierKeyframeType[BezierKeyframeType["EASE_OUT"] = 3] = "EASE_OUT";
88
+ BezierKeyframeType[BezierKeyframeType["LINE"] = 4] = "LINE";
89
+ BezierKeyframeType[BezierKeyframeType["HOLD"] = 5] = "HOLD";
90
+ BezierKeyframeType[BezierKeyframeType["LINE_OUT"] = 6] = "LINE_OUT";
91
+ })(BezierKeyframeType || (BezierKeyframeType = {}));
@@ -1,11 +1,12 @@
1
- import type { Composition } from './composition';
1
+ import type { Composition, CompositionData } from './composition';
2
2
  import type { SpineResource } from './item/spine-item';
3
3
  import type { PlayerVersion, Shape } from './type';
4
4
  import type { TemplateImage, Image, CompressedImage, TextureDefine } from './image';
5
5
  import type { FontBase, FontDefine } from './text';
6
6
  import type { BinaryFile } from './binary';
7
- import type { ComponentData, GeometryData, MaterialData, ShaderData } from './components';
7
+ import type { ComponentData, EffectsObjectData, GeometryData, MaterialData, ShaderData } from './components';
8
8
  import type { VFXItemData } from './vfx-item-data';
9
+ import type { AnimationClipData } from './animation-clip-data';
9
10
  /**
10
11
  * runtime 2.0 之前的场景信息
11
12
  * 素材信息存放于统一数据结构中
@@ -24,8 +25,9 @@ export interface JSONSceneLegacy {
24
25
  * 2.1 增加文本元素
25
26
  * 2.2 数据类型兼容
26
27
  * 2.3 新增动态视频、陀螺仪支持旋转
28
+ * 2.4 支持贝塞尔曲线
27
29
  */
28
- version: '1.0' | '1.1' | '1.2' | '1.3' | '1.5' | '1.8' | '2.0' | '2.1' | '2.2' | '2.3';
30
+ version: '1.0' | '1.1' | '1.2' | '1.3' | '1.5' | '1.8' | '2.0' | '2.1' | '2.2' | '2.3' | '2.4';
29
31
  /**
30
32
  * 播放器版本信息
31
33
  */
@@ -117,25 +119,25 @@ export interface JSONScene {
117
119
  type: string;
118
120
  /*************************************** 用于加载 json 后复原合成 **************************************/
119
121
  /**
120
- * 选中合成ID
122
+ * 选中合成 ID
121
123
  * 如果没有设置,选择合成中的第一个
122
124
  */
123
125
  compositionId?: string;
124
126
  /**
125
127
  * 渲染所需合成列表
126
128
  */
127
- compositions: Composition[];
129
+ compositions: CompositionData[];
128
130
  /******************************** 以下皆为可复用信息,加载在对应 Manager 中 *******************************/
129
131
  /**
130
132
  * 贴图信息
131
133
  */
132
134
  images: (TemplateImage | Image | CompressedImage)[];
133
135
  /**
134
- * 根据合成ID,每个合成用到的 image 的数组索引
136
+ * 根据合成 ID,每个合成用到的 image 的数组索引
135
137
  */
136
138
  imgUsage?: Record<string, number[]>;
137
139
  /**
138
- * 根据合成id,每个合成用到的 bin 的数组索引
140
+ * 根据合成 ID,每个合成用到的 bin 的数组索引
139
141
  */
140
142
  binUsage?: Record<string, number[]>;
141
143
  /**
@@ -152,19 +154,12 @@ export interface JSONScene {
152
154
  * 数据模板下掉可以不要 FontBase[]
153
155
  */
154
156
  fonts?: FontBase[] | FontDefine[];
155
- /**
156
- * spine 资源
157
- * @version 1.5
158
- */
159
- spines?: SpineResource[];
160
157
  /**
161
158
  * 二进制文件地址
162
- * @version 1.3
163
159
  */
164
160
  bins?: BinaryFile[];
165
161
  /**
166
162
  * textures 配置
167
- * 从 v1.3 开始,images 数组会对应创建 textures 数组
168
163
  */
169
164
  textures?: TextureDefine[];
170
165
  /**
@@ -187,4 +182,12 @@ export interface JSONScene {
187
182
  * 几何体数据
188
183
  */
189
184
  geometries: GeometryData[];
185
+ /**
186
+ * 动画数据
187
+ */
188
+ animations: AnimationClipData[];
189
+ /**
190
+ * 分类外的资产数据
191
+ */
192
+ miscs: EffectsObjectData[];
190
193
  }
package/es/scene.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -50,52 +50,6 @@ export interface FontBase {
50
50
  */
51
51
  letterSpace?: number;
52
52
  }
53
- export interface Text {
54
- x: number;
55
- y: number;
56
- /**
57
- * 变量名
58
- */
59
- n?: string;
60
- /**
61
- * content,
62
- * 文字内容,如果包含 $var$ 样式,内容将被替换
63
- */
64
- t: string;
65
- /**
66
- * width, if not provide use canvas.measureText() to get width
67
- * 文字最大宽度,如果不设置,由系统进行计算
68
- */
69
- w?: number;
70
- /**
71
- * font, index to fonts array
72
- * 字体,指向字体数组
73
- * @default 0
74
- */
75
- f?: number;
76
- /**
77
- * textAlignment
78
- * 字体排列
79
- * @default 0
80
- */
81
- a?: TextAlignment;
82
- /**
83
- * index to color array
84
- * 字体颜色,指向数组
85
- */
86
- c?: number;
87
- /**
88
- * 当文字超过最大宽度时,文字的表现行为
89
- * 仅当设置文字最大宽度后生效
90
- * @default 0
91
- */
92
- of?: TextOverflow;
93
- /**
94
- * 当文字overflow为ellipsis时的替换符号
95
- * @default ".."
96
- */
97
- et?: string;
98
- }
99
53
  export declare enum TextOverflow {
100
54
  /**
101
55
  * display 模式下,会显示所有文本,存在文本超过边界框的情况。
@@ -127,7 +81,7 @@ export declare enum TextBaseline {
127
81
  export declare enum TextAlignment {
128
82
  /**
129
83
  * text alignment starts from(x,y) to right direction
130
- * 从(x,y)开始第一个字符,向右边延伸
84
+ * 从 (x,y) 开始第一个字符,向右边延伸
131
85
  */
132
86
  left = 0,
133
87
  /**
@@ -137,7 +91,7 @@ export declare enum TextAlignment {
137
91
  middle = 1,
138
92
  /**
139
93
  * text alignment ends with(x,y) from left direction
140
- * 从(x,y)结束最后一个字符,向左边延伸
94
+ * 从 (x,y) 结束最后一个字符,向左边延伸
141
95
  */
142
96
  right = 2
143
97
  }
@@ -165,7 +119,7 @@ export declare enum FontStyle {
165
119
  /**
166
120
  * 正常
167
121
  */
168
- normal = "normal",
122
+ normal = "normal",// default
169
123
  /**
170
124
  * 斜体
171
125
  */
package/es/text.js ADDED
@@ -0,0 +1,84 @@
1
+ export var TextOverflow;
2
+ (function (TextOverflow) {
3
+ /**
4
+ * display 模式下,会显示所有文本,存在文本超过边界框的情况。
5
+ */
6
+ TextOverflow[TextOverflow["display"] = 0] = "display";
7
+ /**
8
+ * clip 模式下,当文本内容超出边界框时,多余的会被截断。
9
+ */
10
+ TextOverflow[TextOverflow["clip"] = 1] = "clip";
11
+ /**
12
+ * ellipsis 模式下,会使用(...)来代替超出边界框的内容。
13
+ */
14
+ TextOverflow[TextOverflow["ellipsis"] = 2] = "ellipsis";
15
+ })(TextOverflow || (TextOverflow = {}));
16
+ export var TextBaseline;
17
+ (function (TextBaseline) {
18
+ /**
19
+ * 文本顶对齐。
20
+ */
21
+ TextBaseline[TextBaseline["top"] = 0] = "top";
22
+ /**
23
+ * 文本垂直居中对齐。
24
+ */
25
+ TextBaseline[TextBaseline["middle"] = 1] = "middle";
26
+ /**
27
+ * 文本底对齐。
28
+ */
29
+ TextBaseline[TextBaseline["bottom"] = 2] = "bottom";
30
+ })(TextBaseline || (TextBaseline = {}));
31
+ export var TextAlignment;
32
+ (function (TextAlignment) {
33
+ /**
34
+ * text alignment starts from(x,y) to right direction
35
+ * 从 (x,y) 开始第一个字符,向右边延伸
36
+ */
37
+ TextAlignment[TextAlignment["left"] = 0] = "left";
38
+ /**
39
+ * (x,y) is middle position of text, where (left + right)/2 =(x,y)
40
+ * (x,y) 为文字中间位置,(最左位置 + 最右位置)/2 = (x,y)
41
+ */
42
+ TextAlignment[TextAlignment["middle"] = 1] = "middle";
43
+ /**
44
+ * text alignment ends with(x,y) from left direction
45
+ * 从 (x,y) 结束最后一个字符,向左边延伸
46
+ */
47
+ TextAlignment[TextAlignment["right"] = 2] = "right";
48
+ })(TextAlignment || (TextAlignment = {}));
49
+ /**
50
+ * 文本字重
51
+ */
52
+ export var TextWeight;
53
+ (function (TextWeight) {
54
+ /**
55
+ * 正常
56
+ */
57
+ TextWeight["normal"] = "normal";
58
+ /**
59
+ * 粗体
60
+ */
61
+ TextWeight["bold"] = "bold";
62
+ /**
63
+ * 瘦体
64
+ */
65
+ TextWeight["lighter"] = "lighter";
66
+ })(TextWeight || (TextWeight = {}));
67
+ /**
68
+ * 文本样式
69
+ */
70
+ export var FontStyle;
71
+ (function (FontStyle) {
72
+ /**
73
+ * 正常
74
+ */
75
+ FontStyle["normal"] = "normal";
76
+ /**
77
+ * 斜体
78
+ */
79
+ FontStyle["italic"] = "italic";
80
+ /**
81
+ * 倾斜体
82
+ */
83
+ FontStyle["oblique"] = "oblique";
84
+ })(FontStyle || (FontStyle = {}));
@@ -0,0 +1,5 @@
1
+ export * from './track/track-asset-data';
2
+ export * from './playables/sprite-color-playable-asset-data';
3
+ export * from './timeline-asset-data';
4
+ export * from './timeline-clip-data';
5
+ export * from './playables/transform-playable-asset-data';
@@ -0,0 +1,5 @@
1
+ export * from './track/track-asset-data';
2
+ export * from './playables/sprite-color-playable-asset-data';
3
+ export * from './timeline-asset-data';
4
+ export * from './timeline-clip-data';
5
+ export * from './playables/transform-playable-asset-data';
@@ -0,0 +1,8 @@
1
+ import type { DataType, EffectsObjectData } from '../../components';
2
+ import type { RGBAColorValue } from '../../number-expression';
3
+ import type { ColorOverLifetime } from '../../type';
4
+ export interface SpriteColorPlayableAssetData extends EffectsObjectData {
5
+ dataType: DataType.SpriteColorPlayableAsset;
6
+ colorOverLifetime?: ColorOverLifetime;
7
+ startColor?: RGBAColorValue;
8
+ }