diff --git a/game/presentation/views/ui_kit.gd b/game/presentation/views/ui_kit.gd index b76deb00..2e6840ae 100644 --- a/game/presentation/views/ui_kit.gd +++ b/game/presentation/views/ui_kit.gd @@ -443,8 +443,31 @@ static func danger_button(text: String, tip := "") -> Button: return b +# 卡顶类型色带·Bayer 有序抖动(UI 设计对齐批 P8 甲 2026-10-06——bcard band 平涂 ColorRect 退役; +# demo CSS 平滑渐变/blur 违反像素纪律,改 4×4 Bayer 有序抖动台阶:α 由深至 0,2px 元胞逐行降覆盖; +# 纯静态绘制零动效(减动效无涉);Bayer 阶数=实现细节白名单项,取 4×4) +class DitherBand: + extends Control + var band: Color + + func _init(c: Color) -> void: + band = c + custom_minimum_size = Vector2(0, 8) # 8px = 4×4 Bayer 全周期(原平涂条 6px) + + func _draw() -> void: + var bayer := [[0, 8, 2, 10], [12, 4, 14, 6], [3, 11, 1, 9], [15, 7, 13, 5]] + var cell := 2.0 + var rows := int(ceil(custom_minimum_size.y / cell)) + var cols := int(ceil(size.x / cell)) + for ry in rows: + var cover := 1.0 - float(ry) / float(rows) # 顶行全覆盖 → 底行趋零 + for rx in cols: + if float(bayer[ry % 4][rx % 4]) / 16.0 < cover: + draw_rect(Rect2(float(rx) * cell, float(ry) * cell, cell, cell), band, true) + + # bcard 竖卡工厂(商店/三选一同构卡——M6/M7 共用;M7.1 差异仅=价签 vs ✓选择章) -# 返回 {panel, mark, band, icon, name_l, desc_l, price_l, foot_l};set_selected 经 mark/样式换装 +# set_selected 经 mark/样式换装 class BCard: extends PanelContainer var mark: Label @@ -467,9 +490,7 @@ class BCard: box.add_theme_constant_override("separation", 8) add_child(box) body = box - var band_r := ColorRect.new() - band_r.color = band - band_r.custom_minimum_size = Vector2(0, 6) + var band_r := DitherBand.new(band) # P8 甲:卡顶类型色带=Bayer 有序抖动带(随各 TG_* 逐卡着色) box.add_child(band_r) mark = UiKit.label("✓",FS_BODY, true, Color8(58, 42, 8)) mark.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT