diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-22 00:35:03 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-22 00:35:03 +0800 |
| commit | 1cef3b1544ff8574c7b56bc1a84e3be0846a9b22 (patch) | |
| tree | 5aa705bf3e9cfe82e5e3637cdc699bc52f93c559 /src/LivingVillage.Desktop/LaunchScreen.fs | |
| parent | 1f1c502ba750c4c55ac2aca28eacafcd0c3ae932 (diff) | |
| parent | 81a84f9f86d59387a349caa339148c7a7a6d1e72 (diff) | |
| download | living-village-1cef3b1544ff8574c7b56bc1a84e3be0846a9b22.tar.gz | |
merge: P16 启动画面/开始界面/HUD 精美化(独立复验全绿 Desktop 106/Kernel 89)
Diffstat (limited to 'src/LivingVillage.Desktop/LaunchScreen.fs')
| -rw-r--r-- | src/LivingVillage.Desktop/LaunchScreen.fs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop/LaunchScreen.fs b/src/LivingVillage.Desktop/LaunchScreen.fs new file mode 100644 index 0000000..0fecc6d --- /dev/null +++ b/src/LivingVillage.Desktop/LaunchScreen.fs @@ -0,0 +1,47 @@ +namespace LivingVillage.Desktop + +/// 启动画面:固定的 60Hz 步进下,全部为帧计数的纯函数,确定性可复现。 +/// 标题淡入(revealProgress)、整屏暗幕退场(veilAlpha),Esc/空格可随时跳过。 +module LaunchScreen = + + let durationFrames = 150L + let fadeInFrames = 45L + let title = "江南水乡" + let subtitle = "Living Village" + let skipHint = "ESC 或 空格 跳过" + + let private clamp01 (value: float32) : float32 = + if value < 0.0f then 0.0f + elif value > 1.0f then 1.0f + else value + + /// 0 = 完全未显示,1 = 完全显现。帧计数纯函数。 + let revealProgress (frame: int64) : float32 = + if frame <= 0L then 0.0f + else clamp01 (float32 frame / float32 fadeInFrames) + + /// 整屏暗幕:起手 1,随进程退到 0(1 -> 0)。 + let veilAlpha (frame: int64) : float32 = + if frame <= 0L then 1.0f + elif frame >= durationFrames then 0.0f + else 1.0f - clamp01 (float32 frame / float32 durationFrames) + + let isComplete (frame: int64) : bool = frame >= durationFrames + + /// Esc 或 空格 触发跳过(调用方用“按下沿”结果,不做按键状态判定)。 + let skipRequested (escapePressed: bool) (spacePressed: bool) : bool = escapePressed || spacePressed + +/// P16-FIX 证据补拍:开始界面菜单截图的确定性帧表(纯数据,Game 与回归测试共用)。 +/// 帧号均为 60Hz Update 计数:splash 淡入中 -> 菜单入场完成(初始高亮「开始」)-> 向下 +/// -> 高亮「读档」-> 退出。输出文件名不含目录与扩展名。 +module MenuShotScript = + + let splashMidName = "frame-splash-mid-01" + let initialName = "menu-real-initial" + let loadName = "menu-real-load" + + let splashMidFrame = 30L + let initialFrame = 130L + let downFrame = 140L + let loadFrame = 150L + let exitFrame = 170L |
