@taole/giftstage 0.1.16 → 0.1.18

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/README.md CHANGED
@@ -181,6 +181,8 @@ Promise<GiftHandle>;
181
181
 
182
182
  - `.to(step)` / `.then(step)`
183
183
  - 追加动画步骤(两者等价)
184
+ - `.delay(milliseconds)`
185
+ - 在链中插入等待,不改变位置、缩放和透明度
184
186
  - `.onComplete((gift) => void)`
185
187
  - 整条链执行完成后的回调
186
188
  - `.start(mode?)`
@@ -401,6 +403,11 @@ await gift
401
403
  opacity: 1,
402
404
  duration: 700,
403
405
  })
406
+ .delay(300)
407
+ .then({
408
+ opacity: 0,
409
+ duration: 400,
410
+ })
404
411
  .onComplete((g) => {
405
412
  console.log('chain complete', g.id);
406
413
  })
@@ -460,6 +467,34 @@ SVGA 文本配置会按目标 frame 自动适配字号,避免文字超出槽
460
467
  - `minFontSize?: number` / `maxFontSize?: number`:限制自适应字号范围。
461
468
  - `padding?: number`:文字纹理内边距,默认 `2`。
462
469
  - `scale?: number`:文字纹理栅格倍率,SVGA 默认 `3`,用于保持清晰度。
470
+ - `fontStyle?: string | { font?: string; color?: string }`:字体样式,SVGA / VAP 都支持。
471
+
472
+ `fontStyle` 可以直接传 canvas font 字符串:
473
+
474
+ ```ts
475
+ svgaSlots: {
476
+ title: {
477
+ text: 'Hello',
478
+ fontStyle: 'bold 40px Arial',
479
+ },
480
+ }
481
+ ```
482
+
483
+ 也可以传对象:
484
+
485
+ ```ts
486
+ vapSlots: {
487
+ welcome01: {
488
+ text: '欢迎进入房间',
489
+ fontStyle: {
490
+ font: 'bold 40px Arial',
491
+ color: '#ffffff',
492
+ },
493
+ },
494
+ }
495
+ ```
496
+
497
+ 对象形式目前生效字段是 `font` 和 `color`。如果同时传了外层 `color` 和 `fontStyle.color`,以 `fontStyle.color` 为准。VAP 文本如果没有传 `fontStyle`,会回退使用 VAP 配置里的 `src.fontStyle`。
463
498
 
464
499
  ### VAP / VAPX
465
500