@galacean/effects-core 2.0.0-alpha.20 → 2.0.0-alpha.22

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.
@@ -52,7 +52,7 @@ export type Region = {
52
52
  position: Vector3;
53
53
  behavior?: spec.InteractBehavior;
54
54
  parentId?: string;
55
- hitPositions?: Vector3[];
55
+ hitPositions: Vector3[];
56
56
  };
57
57
  export type HitTestParams = {
58
58
  camera: {
@@ -15,6 +15,18 @@ export declare class InteractComponent extends RendererComponent {
15
15
  bouncingArg: TouchEventType | null;
16
16
  previewContent: InteractMesh | null;
17
17
  interactData: spec.InteractContent;
18
+ /**
19
+ * 拖拽的惯性衰减系数,范围[0, 1], 越大惯性越强
20
+ */
21
+ downgrade: number;
22
+ /**
23
+ * 拖拽的距离映射系数,越大越容易拖动
24
+ */
25
+ dragRatio: number[];
26
+ /** 是否响应点击和拖拽交互事件 */
27
+ private _interactive;
28
+ set interactive(enable: boolean);
29
+ get interactive(): boolean;
18
30
  start(): void;
19
31
  update(dt: number): void;
20
32
  render(renderer: Renderer): void;
@@ -25,4 +37,5 @@ export declare class InteractComponent extends RendererComponent {
25
37
  getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
26
38
  getBoundingBox(): BoundingBoxTriangle | void;
27
39
  fromData(data: spec.InteractContent): void;
40
+ canInteract(): boolean;
28
41
  }
@@ -14,6 +14,10 @@ export interface TextComponent extends TextComponentBase {
14
14
  */
15
15
  export declare class TextComponent extends SpriteComponent {
16
16
  isDirty: boolean;
17
+ /**
18
+ * 文本行数
19
+ */
20
+ lineCount: number;
17
21
  constructor(engine: Engine, props?: spec.TextContent);
18
22
  update(dt: number): void;
19
23
  fromData(data: SpriteItemProps): void;
@@ -30,9 +34,11 @@ export declare class TextComponentBase {
30
34
  isDirty: boolean;
31
35
  engine: Engine;
32
36
  material: Material;
37
+ lineCount: number;
33
38
  /***** mix 类型兼容用 *****/
34
39
  private char;
35
40
  updateWithOptions(options: spec.TextContentOptions): void;
41
+ private getLineCount;
36
42
  /**
37
43
  * 设置字号大小
38
44
  * @param value - 字号
@@ -17,7 +17,15 @@ export declare class TextLayout {
17
17
  */
18
18
  lineHeight: number;
19
19
  constructor(options: spec.TextContentOptions);
20
- getOffsetY(style: TextStyle): number;
20
+ /**
21
+ * 获取初始的行高偏移值
22
+ * @param style - 字体基础数据
23
+ * @param lineCount - 渲染行数
24
+ * @param lineHeight - 渲染时的字体行高
25
+ * @param fontSize - 渲染时的字体大小
26
+ * @returns - 行高偏移值
27
+ */
28
+ getOffsetY(style: TextStyle, lineCount: number, lineHeight: number, fontSize: number): number;
21
29
  getOffsetX(style: TextStyle, maxWidth: number): number;
22
30
  /**
23
31
  * 设置文本框的宽度和高度
package/dist/scene.d.ts CHANGED
@@ -25,6 +25,10 @@ export interface Scene {
25
25
  * 加载开始时间
26
26
  */
27
27
  startTime?: number;
28
+ /**
29
+ * 加载分段时长
30
+ */
31
+ timeInfos: Record<string, number>;
28
32
  url: SceneType;
29
33
  usedImages: Record<number, boolean>;
30
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-core",
3
- "version": "2.0.0-alpha.20",
3
+ "version": "2.0.0-alpha.22",
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.0.0-alpha.19",
45
+ "@galacean/effects-specification": "2.0.0-alpha.20",
46
46
  "@galacean/effects-math": "1.1.0",
47
47
  "uuid": "9.0.1"
48
48
  },