跳转到正文
iPlugin

屏幕过场

Letterbox、Scene、图层、Wipe 和过渡字段参考

Screen 配置位于 core/display/screens,顶层节点是效果 ID。

需要完整操作流程时,先阅读Screen 过场制作。本页代码未标为完整文件时,均为对应节点中的片段。

文件关系

图片组/
tutorial_scene.yml
tutorial.yml

每种图层只需要对应类型的字段,不要把所有字段复制到同一图层。Screen 的纯黑边和程序化遮罩不需要 PNG;Image 需先登记图片,Layout 需先准备字体、图片与局部 Layout。

顶层效果字段

字段类型 / 省略值适用类型范围或说明生效
type字符串 / letterbox全部letterbox、scene打包
priority整数 / 0全部数值高的效果显示在上层重载
mode字符串 / fixedLetterboxfixed、aspect-ratio打包
height整数 / 36Letterbox0~512 GUI 像素,fixed 使用打包
ratio小数 / 2.39Letterbox1~10,aspect-ratio 使用打包
color#RRGGBB / #000000Letterbox黑边颜色打包
opacity小数 / 1Letterbox0~1打包
top布尔 / trueLetterbox是否显示上边打包
bottom布尔 / trueLetterbox是否显示下边打包
animation对象Letterbox整体进入和退出打包
duration整数 / 自动Scene1~12000 tick;0 时按最后图层计算打包
markers名称到 tick 映射 / 空Scenetick 必须位于 Scene 内重载
layers有序映射 / 必填Scene后写的图层绘制在前面打包

Letterbox 的 top 和 bottom 至少有一个为 true。

Letterbox animation

animation:
  enter:
    duration: 12
    easing: ease-out
  exit:
    duration: 10
    easing: ease-in
字段类型 / 省略值范围
enter.duration整数 / 120~1200 tick
enter.easing字符串 / ease-out四种缓动
exit.duration整数 / 100~1200 tick
exit.easing字符串 / ease-in四种缓动

缓动:linear、ease-in、ease-out、ease-in-out。

Scene 图层通用字段

字段类型 / 省略值范围说明
type字符串 / shapeshape、wipe、image、layout图层类型
start整数 / 00~12000 tick在 Scene 中开始时间
duration整数 / 201~12000 tick图层时长;分阶段 Wipe 见下文
color#RRGGBB / #FFFFFF六位十六进制颜色或图片染色
opacity小数 / 10~1整体透明度
easing字符串 / ease-in-out四种缓动Shape 等图层的变化曲线
anchor.x/y小数 / 50,500~100屏幕百分比锚点
x/y小数 / 0有限数字相对锚点像素,Y 正数向上

Shape 字段

flash:
  type: shape
  animation: flash
  color: "#FFD94A"
  opacity: 0.7
  duration: 24

animation 可选:

  • fill: 始终显示。
  • fade-in: 淡入。
  • fade-out: 淡出。
  • flash: 闪烁一次。
  • pulse: 闪烁两次。

Wipe 基础字段

字段类型 / 省略值可选值或范围说明
style字符串 / bandband、cover、reveal色带、覆盖或揭示
pattern字符串 / linear见下表遮罩图案
direction字符串 / left-to-right四个方向Linear、Blinds、Stripes 方向
mode字符串 / center-outcenter-out、edges-inSplit 模式
angle小数 / 0-75~75 度Linear 斜边角度
width小数 / 160大于 0,不超过 4096Band 宽度或图案尺度
softness小数 / 00~0.5遮罩边缘柔和度
count整数 / 81~64Blinds、Stripes 数量
columns整数 / 121~64Checker、Dissolve 横向密度
rows整数 / 71~64Checker、Dissolve 纵向密度
stagger小数 / 00~1各条或格子的错开程度
seed整数 / 0任意整数固定随机图案
start-angle小数 / -90-360~360Radial 起始角度
clockwise布尔 / truetrue/falseRadial 是否顺时针

图案:

  • linear
  • circle
  • diamond
  • radial
  • split
  • blinds
  • checker
  • dissolve
  • stripes

band 只支持 linear。

分阶段 Wipe

cover 和 reveal 可以使用:

enter:
  duration: 18
  easing: ease-out
hold: 8
exit:
  duration: 18
  easing: ease-in

只要 enter、hold 或 exit 其中一个非零,图层总时长改为:

enter.duration + hold + exit.duration

此时至少需要进入或退出动画之一。

Image 图层

logo:
  type: image
  image:
    namespace: xerr_ui
    basename: icon
    id: scene_logo
  width: 192
  height: 0
  rotation: 0
  distance: 180
  overshoot: 1.15
字段类型 / 省略值范围说明
image.namespace字符串 / 必填非空图片命名空间
image.basename字符串 / 必填非空图片组
image.id字符串 / 必填非空图片 ID
width小数 / 1600~4096显示宽度
height小数 / 00~4096显示高度;只填一边时保持比例
rotation小数 / 0有限数字旋转角度
distance小数 / 800~4096Slide 进入和退出距离
overshoot小数 / 1.151~4Pop 放大回弹幅度
enter/exitTransition见下文图片过渡

width 和 height 至少一个大于 0。两者都填写时允许拉伸。只按高度缩放时,需要显式写 width: 0,否则 width 会使用省略值 160,并与 height 同时生效。

Layout 图层

content:
  type: layout
  layout: screen_scene_title
  variables:
    title: "区域解锁"
  refresh: 10
  distance: 72
字段类型 / 省略值说明
layoutLayout ID / 必填完整 Layout,内部使用局部坐标
variables字符串映射 / 空传给 Layout
refresh正整数 / 5内容刷新 tick
distance小数 / 80Slide 距离
enter/exitTransition只支持 none、fade 和四方向 slide-*

完整 Layout 不支持整体 Zoom、Pop 或 Spin,因为内部文字、头像和进度各自定位。

Transition 字段

字段类型 / 省略值范围说明
effect字符串 / nonenone、fade、zoom、pop、spin、四方向 slide-*过渡效果
duration整数 / 00~1200 tick过渡时长
easing字符串 / linear四种缓动速度曲线

Image 的进入和退出总时长不能超过图层 duration。Layout 同样受此限制。

Marker

markers:
  covered: 18

Marker 名称不能为空,tick 必须小于 Scene 总时长。它不会自动执行命令,而是供 Kether、API 和事件等待。