summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop/HudLayout.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-22 10:14:31 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-22 10:14:31 +0800
commitb377e750a6a3f35c5d64a29f14ac3fbd87d4a752 (patch)
tree8baac5fca38fdcecda4a00eed7a58b1031ab9dca /src/LivingVillage.Desktop/HudLayout.fs
parentd36e86ac637ccc477479f88bea511c49b0a6a67c (diff)
parent5f12e63f2d2203267c30666f1559e06ec637b91c (diff)
downloadliving-village-b377e750a6a3f35c5d64a29f14ac3fbd87d4a752.tar.gz
merge: P26 美术整改(民居第二变体/河岸装饰/夜月光/HUD 双景可读)— Hermes 复验通过
Diffstat (limited to 'src/LivingVillage.Desktop/HudLayout.fs')
-rw-r--r--src/LivingVillage.Desktop/HudLayout.fs22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/LivingVillage.Desktop/HudLayout.fs b/src/LivingVillage.Desktop/HudLayout.fs
index d943cec..f3e4c12 100644
--- a/src/LivingVillage.Desktop/HudLayout.fs
+++ b/src/LivingVillage.Desktop/HudLayout.fs
@@ -44,14 +44,26 @@ module HudLayout =
(paddingX, [])
List.rev placed
+ /// P26:常驻片段文本的 1px 描边偏移(上/下/左/右),保证白天/夜景下都可读。
+ let textOutlineOffsets : (int * int) list = [ (-1, 0); (1, 0); (0, -1); (0, 1) ]
+
+ /// P26:常驻片段的半透明底色药丸,贴合文字高度并在左右各留 6px;纯函数便于回归。
+ let segmentBackdrop (x: int) (width: int) : Microsoft.Xna.Framework.Rectangle =
+ let height = 8 * textScale + 10
+ let y = (barHeight - height) / 2
+ Microsoft.Xna.Framework.Rectangle(x - 6, y, width + 12, height)
+
type Palette =
{ BarTop: Color
BarBottom: Color
Accent: Color
Label: Color
- Value: Color }
+ Value: Color
+ SegmentBackdrop: Color
+ Outline: Color }
/// 白天暖色 / 夜晚(冬夜)冷色微调;均为半透明渐变窄条,无大黑块。
+ /// 每个常驻片段再叠一层半透明底色 + 1px 深色描边,双时段都能读清。
let palette (mode: M6DayNight) : Palette =
match mode with
| Day ->
@@ -59,10 +71,14 @@ module HudLayout =
BarBottom = Color(22, 34, 40, 200)
Accent = Color(212, 168, 96)
Label = Color(206, 220, 208)
- Value = Color(242, 248, 234) }
+ Value = Color(242, 248, 234)
+ SegmentBackdrop = Color(8, 14, 20, 150)
+ Outline = Color(6, 10, 14, 255) }
| Night ->
{ BarTop = Color(22, 30, 48, 205)
BarBottom = Color(13, 19, 33, 205)
Accent = Color(120, 168, 196)
Label = Color(176, 196, 214)
- Value = Color(228, 238, 246) }
+ Value = Color(228, 238, 246)
+ SegmentBackdrop = Color(4, 8, 16, 160)
+ Outline = Color(3, 6, 12, 255) }