屏幕过场
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 | 字符串 / fixed | Letterbox | fixed、aspect-ratio | 打包 |
height | 整数 / 36 | Letterbox | 0~512 GUI 像素,fixed 使用 | 打包 |
ratio | 小数 / 2.39 | Letterbox | 1~10,aspect-ratio 使用 | 打包 |
color | #RRGGBB / #000000 | Letterbox | 黑边颜色 | 打包 |
opacity | 小数 / 1 | Letterbox | 0~1 | 打包 |
top | 布尔 / true | Letterbox | 是否显示上边 | 打包 |
bottom | 布尔 / true | Letterbox | 是否显示下边 | 打包 |
animation | 对象 | Letterbox | 整体进入和退出 | 打包 |
duration | 整数 / 自动 | Scene | 1~12000 tick;0 时按最后图层计算 | 打包 |
markers | 名称到 tick 映射 / 空 | Scene | tick 必须位于 Scene 内 | 重载 |
layers | 有序映射 / 必填 | Scene | 后写的图层绘制在前面 | 打包 |
Letterbox 的 top 和 bottom 至少有一个为 true。
Letterbox animation
animation:
enter:
duration: 12
easing: ease-out
exit:
duration: 10
easing: ease-in| 字段 | 类型 / 省略值 | 范围 |
|---|---|---|
enter.duration | 整数 / 12 | 0~1200 tick |
enter.easing | 字符串 / ease-out | 四种缓动 |
exit.duration | 整数 / 10 | 0~1200 tick |
exit.easing | 字符串 / ease-in | 四种缓动 |
缓动:linear、ease-in、ease-out、ease-in-out。
Scene 图层通用字段
| 字段 | 类型 / 省略值 | 范围 | 说明 |
|---|---|---|---|
type | 字符串 / shape | shape、wipe、image、layout | 图层类型 |
start | 整数 / 0 | 0~12000 tick | 在 Scene 中开始时间 |
duration | 整数 / 20 | 1~12000 tick | 图层时长;分阶段 Wipe 见下文 |
color | #RRGGBB / #FFFFFF | 六位十六进制 | 颜色或图片染色 |
opacity | 小数 / 1 | 0~1 | 整体透明度 |
easing | 字符串 / ease-in-out | 四种缓动 | Shape 等图层的变化曲线 |
anchor.x/y | 小数 / 50,50 | 0~100 | 屏幕百分比锚点 |
x/y | 小数 / 0 | 有限数字 | 相对锚点像素,Y 正数向上 |
Shape 字段
flash:
type: shape
animation: flash
color: "#FFD94A"
opacity: 0.7
duration: 24animation 可选:
fill: 始终显示。fade-in: 淡入。fade-out: 淡出。flash: 闪烁一次。pulse: 闪烁两次。
Wipe 基础字段
| 字段 | 类型 / 省略值 | 可选值或范围 | 说明 |
|---|---|---|---|
style | 字符串 / band | band、cover、reveal | 色带、覆盖或揭示 |
pattern | 字符串 / linear | 见下表 | 遮罩图案 |
direction | 字符串 / left-to-right | 四个方向 | Linear、Blinds、Stripes 方向 |
mode | 字符串 / center-out | center-out、edges-in | Split 模式 |
angle | 小数 / 0 | -75~75 度 | Linear 斜边角度 |
width | 小数 / 160 | 大于 0,不超过 4096 | Band 宽度或图案尺度 |
softness | 小数 / 0 | 0~0.5 | 遮罩边缘柔和度 |
count | 整数 / 8 | 1~64 | Blinds、Stripes 数量 |
columns | 整数 / 12 | 1~64 | Checker、Dissolve 横向密度 |
rows | 整数 / 7 | 1~64 | Checker、Dissolve 纵向密度 |
stagger | 小数 / 0 | 0~1 | 各条或格子的错开程度 |
seed | 整数 / 0 | 任意整数 | 固定随机图案 |
start-angle | 小数 / -90 | -360~360 | Radial 起始角度 |
clockwise | 布尔 / true | true/false | Radial 是否顺时针 |
图案:
linearcirclediamondradialsplitblindscheckerdissolvestripes
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 | 小数 / 160 | 0~4096 | 显示宽度 |
height | 小数 / 0 | 0~4096 | 显示高度;只填一边时保持比例 |
rotation | 小数 / 0 | 有限数字 | 旋转角度 |
distance | 小数 / 80 | 0~4096 | Slide 进入和退出距离 |
overshoot | 小数 / 1.15 | 1~4 | Pop 放大回弹幅度 |
enter/exit | Transition | 见下文 | 图片过渡 |
width 和 height 至少一个大于 0。两者都填写时允许拉伸。只按高度缩放时,需要显式写 width: 0,否则 width 会使用省略值 160,并与 height 同时生效。
Layout 图层
content:
type: layout
layout: screen_scene_title
variables:
title: "区域解锁"
refresh: 10
distance: 72| 字段 | 类型 / 省略值 | 说明 |
|---|---|---|
layout | Layout ID / 必填 | 完整 Layout,内部使用局部坐标 |
variables | 字符串映射 / 空 | 传给 Layout |
refresh | 正整数 / 5 | 内容刷新 tick |
distance | 小数 / 80 | Slide 距离 |
enter/exit | Transition | 只支持 none、fade 和四方向 slide-* |
完整 Layout 不支持整体 Zoom、Pop 或 Spin,因为内部文字、头像和进度各自定位。
Transition 字段
| 字段 | 类型 / 省略值 | 范围 | 说明 |
|---|---|---|---|
effect | 字符串 / none | none、fade、zoom、pop、spin、四方向 slide-* | 过渡效果 |
duration | 整数 / 0 | 0~1200 tick | 过渡时长 |
easing | 字符串 / linear | 四种缓动 | 速度曲线 |
Image 的进入和退出总时长不能超过图层 duration。Layout 同样受此限制。
Marker
markers:
covered: 18Marker 名称不能为空,tick 必须小于 Scene 总时长。它不会自动执行命令,而是供 Kether、API 和事件等待。