@galacean/effects-specification 2.6.0 → 2.7.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.
package/es/assets.d.ts CHANGED
@@ -33,6 +33,16 @@ export declare enum MultimediaType {
33
33
  video = "video",
34
34
  audio = "audio"
35
35
  }
36
+ export declare enum HevcVideoCodec {
37
+ L30 = "hev1.1.0.L30.B0",
38
+ L60 = "hev1.1.0.L60.B0",
39
+ L63 = "hev1.1.0.L63.B0",
40
+ L90 = "hev1.1.0.L90.B0",
41
+ L93 = "hev1.1.0.L93.B0",
42
+ L120 = "hev1.1.0.L120.B0",
43
+ L150 = "hev1.1.0.L150.B0",
44
+ L180 = "hev1.1.0.L180.B0"
45
+ }
36
46
  export interface TemplateContent {
37
47
  /**
38
48
  * 当 template 宽高和 image 不相同时,会对 template 进行缩放,使其和 image 相同。
@@ -69,6 +79,12 @@ export interface Image extends AssetBase {
69
79
  */
70
80
  mipmap?: boolean;
71
81
  }
82
+ export interface VideoInfo extends AssetBase {
83
+ hevc?: {
84
+ url: string | HTMLVideoElement;
85
+ codec: HevcVideoCodec;
86
+ };
87
+ }
72
88
  /**
73
89
  * 模板贴图属性
74
90
  */
@@ -80,10 +96,7 @@ export interface TemplateImage extends Image {
80
96
  */
81
97
  export interface CompressedImage extends Image {
82
98
  /**
83
- * 压缩贴图地址
99
+ * KTX2 地址
84
100
  */
85
- compressed: {
86
- astc?: string;
87
- pvrtc?: string;
88
- };
101
+ ktx2?: string;
89
102
  }
package/es/assets.js CHANGED
@@ -16,3 +16,14 @@ export var MultimediaType;
16
16
  MultimediaType["video"] = "video";
17
17
  MultimediaType["audio"] = "audio";
18
18
  })(MultimediaType || (MultimediaType = {}));
19
+ export var HevcVideoCodec;
20
+ (function (HevcVideoCodec) {
21
+ HevcVideoCodec["L30"] = "hev1.1.0.L30.B0";
22
+ HevcVideoCodec["L60"] = "hev1.1.0.L60.B0";
23
+ HevcVideoCodec["L63"] = "hev1.1.0.L63.B0";
24
+ HevcVideoCodec["L90"] = "hev1.1.0.L90.B0";
25
+ HevcVideoCodec["L93"] = "hev1.1.0.L93.B0";
26
+ HevcVideoCodec["L120"] = "hev1.1.0.L120.B0";
27
+ HevcVideoCodec["L150"] = "hev1.1.0.L150.B0";
28
+ HevcVideoCodec["L180"] = "hev1.1.0.L180.B0";
29
+ })(HevcVideoCodec || (HevcVideoCodec = {}));
package/es/index.d.ts CHANGED
@@ -41,4 +41,4 @@ export * from './material-data';
41
41
  export * from './geometry-data';
42
42
  export * from './shader-data';
43
43
  export * from './effects-package-data';
44
- export declare const LATEST_VERSION = JSONSceneVersion['3_5'];
44
+ export declare const LATEST_VERSION = JSONSceneVersion['3_6'];
@@ -2,6 +2,7 @@ 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';
5
+ import type { TextSizeMode } from '../text';
5
6
  /**
6
7
  * 富文本元素
7
8
  */
@@ -24,6 +25,25 @@ export interface RichTextContentOptions extends BaseTextContentOptions {
24
25
  * 富文本元素大小
25
26
  */
26
27
  size?: vec2;
28
+ /**
29
+ * 文本框宽度,用来排版和控制文本溢出行为
30
+ */
31
+ maxTextWidth?: number;
32
+ /**
33
+ * 文本框高度,用来排版和控制文本溢出行为
34
+ * @default undefined
35
+ */
36
+ maxTextHeight?: number;
37
+ /**
38
+ * 是否开启自动换行
39
+ * @default false
40
+ */
41
+ wrapEnabled?: boolean;
42
+ /**
43
+ * 尺寸模式
44
+ * @default TextSizeMode.autoWidth
45
+ */
46
+ sizeMode?: TextSizeMode;
27
47
  }
28
48
  /**
29
49
  * 富文本元素渲染属性
@@ -79,8 +79,4 @@ export interface SpriteContent {
79
79
  * 图层组件属性
80
80
  */
81
81
  export interface SpriteComponentData extends ComponentData, SpriteContent {
82
- /**
83
- * 图层帧动画是否循环播放
84
- */
85
- loop?: boolean;
86
82
  }
@@ -1,7 +1,7 @@
1
1
  import type { BaseItem, EndBehavior, MaskOptions } 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
- import type { FontStyle, TextAlignment, TextBaseline, TextOverflow, TextWeight, TextSizeMode } from '../text';
4
+ import type { FontStyle, TextAlignment, TextBaseline, TextOverflow, TextWeight, TextVerticalAlign } from '../text';
5
5
  import type { ComponentData } from '../components';
6
6
  /**
7
7
  * 文本元素
@@ -23,11 +23,6 @@ export interface TextContentOptions extends BaseTextContentOptions {
23
23
  * @default 31
24
24
  */
25
25
  textWidth?: number;
26
- /**
27
- * 文本行高
28
- * @default 31
29
- */
30
- lineHeight?: number;
31
26
  /**
32
27
  * 文本高度
33
28
  * @default 31
@@ -39,25 +34,10 @@ export interface TextContentOptions extends BaseTextContentOptions {
39
34
  */
40
35
  autoWidth?: boolean;
41
36
  /**
42
- * 尺寸模式
43
- * @default TextSizeMode.autoWidth
44
- */
45
- sizeMode?: TextSizeMode;
46
- /**
47
- * 文本框宽度,用来排版和控制文本溢出行为
48
- * @default undefined
49
- */
50
- maxTextWidth?: number;
51
- /**
52
- * 文本框高度,用来排版和控制文本溢出行为
53
- * @default undefined
54
- */
55
- maxTextHeight?: number;
56
- /**
57
- * 是否开启自动换行
37
+ * 自适应宽高开关(和文本固定高度冲突)
58
38
  * @default false
59
39
  */
60
- wrapEnabled?: boolean;
40
+ autoHeight?: boolean;
61
41
  }
62
42
  export interface BaseTextContentOptions {
63
43
  /**
@@ -70,6 +50,11 @@ export interface BaseTextContentOptions {
70
50
  * @default 0.571
71
51
  */
72
52
  lineGap?: number;
53
+ /**
54
+ * 文本行高
55
+ * @default 31
56
+ */
57
+ lineHeight?: number;
73
58
  /**
74
59
  * 文本内容
75
60
  */
@@ -94,6 +79,11 @@ export interface BaseTextContentOptions {
94
79
  * @default TextBaseline.middle
95
80
  */
96
81
  textBaseline?: TextBaseline;
82
+ /**
83
+ * 垂直对齐方式
84
+ * @default TextVerticalAlign.middle
85
+ */
86
+ textVerticalAlign?: TextVerticalAlign;
97
87
  /**
98
88
  * 左右对齐方式
99
89
  * @default TextAlignment.left
package/es/scene.d.ts CHANGED
@@ -7,7 +7,7 @@ import type { BinaryFile } from './binary';
7
7
  import type { ComponentData } from './components';
8
8
  import type { VFXItemData } from './vfx-item-data';
9
9
  import type { AnimationClipData } from './animation-clip-data';
10
- import type { AssetBase, ImageSource } from './assets';
10
+ import type { AssetBase, ImageSource, VideoInfo } from './assets';
11
11
  import type { RenderSettings } from './render-settings';
12
12
  import type { EffectsObjectData } from './effects-object-data';
13
13
  import type { MaterialData } from './material-data';
@@ -34,7 +34,8 @@ export declare enum JSONSceneVersion {
34
34
  '3_3' = "3.3",// 指向型蒙版、图片/文字蒙版
35
35
  '3_4' = "3.4",// 动画状态机
36
36
  '3_5' = "3.5",// 网格形状变化动画、矢量图形填充/描边渐变色
37
- 'LATEST' = "3.5"
37
+ '3_6' = "3.6",// 支持 KTX2 纹理、H265 视频格式、文本增强
38
+ 'LATEST' = "3.6"
38
39
  }
39
40
  /**
40
41
  * runtime 2.0 之前的场景信息
@@ -167,7 +168,7 @@ export interface JSONScene {
167
168
  * 视频资源
168
169
  * @since 2.0.0
169
170
  */
170
- videos?: AssetBase[];
171
+ videos?: VideoInfo[];
171
172
  /**
172
173
  * 音频资源
173
174
  * @since 2.0.0
package/es/scene.js CHANGED
@@ -20,5 +20,6 @@ export var JSONSceneVersion;
20
20
  JSONSceneVersion["3_3"] = "3.3";
21
21
  JSONSceneVersion["3_4"] = "3.4";
22
22
  JSONSceneVersion["3_5"] = "3.5";
23
- JSONSceneVersion["LATEST"] = "3.5";
23
+ JSONSceneVersion["3_6"] = "3.6";
24
+ JSONSceneVersion["LATEST"] = "3.6";
24
25
  })(JSONSceneVersion || (JSONSceneVersion = {}));
package/es/text.d.ts CHANGED
@@ -113,6 +113,20 @@ export declare enum TextAlignment {
113
113
  */
114
114
  right = 2
115
115
  }
116
+ export declare enum TextVerticalAlign {
117
+ /**
118
+ * 文本顶对齐。
119
+ */
120
+ top = 0,
121
+ /**
122
+ * 文本垂直居中对齐。
123
+ */
124
+ middle = 1,
125
+ /**
126
+ * 文本底对齐。
127
+ */
128
+ bottom = 2
129
+ }
116
130
  /**
117
131
  * 文本字重
118
132
  */
package/es/text.js CHANGED
@@ -65,6 +65,21 @@ export var TextAlignment;
65
65
  */
66
66
  TextAlignment[TextAlignment["right"] = 2] = "right";
67
67
  })(TextAlignment || (TextAlignment = {}));
68
+ export var TextVerticalAlign;
69
+ (function (TextVerticalAlign) {
70
+ /**
71
+ * 文本顶对齐。
72
+ */
73
+ TextVerticalAlign[TextVerticalAlign["top"] = 0] = "top";
74
+ /**
75
+ * 文本垂直居中对齐。
76
+ */
77
+ TextVerticalAlign[TextVerticalAlign["middle"] = 1] = "middle";
78
+ /**
79
+ * 文本底对齐。
80
+ */
81
+ TextVerticalAlign[TextVerticalAlign["bottom"] = 2] = "bottom";
82
+ })(TextVerticalAlign || (TextVerticalAlign = {}));
68
83
  /**
69
84
  * 文本字重
70
85
  */
package/es/type.d.ts CHANGED
@@ -202,6 +202,10 @@ export interface TextureSheetAnimation {
202
202
  * 帧动画开关
203
203
  */
204
204
  animate: boolean;
205
+ /**
206
+ * 图层帧动画是否循环播放
207
+ */
208
+ loop: boolean;
205
209
  }
206
210
  /**
207
211
  * 精灵图坐标属性
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",