From 3cbf3147a83c18c0532c1f8ad3c3f55315a1fbf9 Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Fri, 25 Sep 2026 06:32:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E8=84=9A=E9=94=9A=E5=8F=82=E7=85=A7?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=80=E8=87=AA=E5=BA=95=E8=BE=B9=E5=8F=A3?= =?UTF-8?q?=E5=BE=84+=E5=BD=B1=E5=AD=90=E8=B4=B4=E8=84=9A=EF=BC=882026-09-?= =?UTF-8?q?26=20=E7=94=A8=E6=88=B7=E4=B8=89=E8=A3=81/=E6=8A=A5=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=EF=BC=89=EF=BC=9A=E2=91=A0HERO=5FGROUND=5FFRAC=200.75?= =?UTF-8?q?(=E8=87=AA=E9=A1=B6)=E2=86=920.25(=E8=87=AA=E5=BA=95=E8=BE=B9)?= =?UTF-8?q?=E2=80=94=E2=80=94=E6=95=B0=E5=80=BC=E5=90=8C=E7=BA=BF=EF=BC=88?= =?UTF-8?q?=E8=87=AA=E9=A1=B6=2075%=E2=89=A1=E8=87=AA=E5=BA=95=2025%?= =?UTF-8?q?=EF=BC=89=E4=BD=86=E4=B8=8A=E4=B8=80=E6=89=B9=E5=85=A8=E7=A8=8B?= =?UTF-8?q?=E3=80=8C75%=E3=80=8D=E5=8F=A3=E5=BE=84=E8=AF=AF=E5=AF=BC?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A2=AB=E7=BA=A0=EF=BC=8C=E5=B8=B8=E9=87=8F?= =?UTF-8?q?/=E5=85=AC=E5=BC=8F/=E6=B3=A8=E9=87=8A/=E6=8E=A2=E9=92=88=20cas?= =?UTF-8?q?e=E2=91=A6=20=E5=85=A8=E9=83=A8=E6=8D=A2=E8=87=AA=E5=BA=95?= =?UTF-8?q?=E8=BE=B9=E5=8F=82=E7=85=A7=E7=B3=BB=E5=B9=B6=E5=8A=A0=20?= =?UTF-8?q?=E2=9A=A0=20=E5=8F=82=E7=85=A7=E7=B3=BB=E7=BA=AA=E5=BE=8B?= =?UTF-8?q?=E6=B3=A8=EF=BC=9B=E2=91=A1=E5=BD=B1=E5=AD=90=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E8=B4=B4=E8=84=9A=E9=94=9A=20(0,2)=E2=86=92(0,0)=E2=80=94?= =?UTF-8?q?=E2=80=94=E4=B8=8A=E6=89=B9=E4=B8=8B=E5=9D=A0=202px(=E5=B1=8F?= =?UTF-8?q?=E5=B9=95=203px)=E8=AE=A9=E6=A4=AD=E5=9C=86=E4=B8=8E=E8=84=9A?= =?UTF-8?q?=E8=84=B1=E5=BC=80=EF=BC=88=E7=94=A8=E6=88=B7=E6=8A=A5=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=EF=BC=89=EF=BC=8C=E8=B4=B4=E8=84=9A=E5=90=8E=E9=9A=8F?= =?UTF-8?q?=E7=88=B6=E5=90=8C=E6=AD=A5=E4=B8=8D=E5=8F=98=EF=BC=9B=E5=86=92?= =?UTF-8?q?=E7=83=9F=20557/0+ui=5Finput=20=E4=B8=83=E6=96=AD=E8=A8=80+clic?= =?UTF-8?q?k=20=E6=8E=A2=E9=92=88=E7=BB=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/presentation/views/board_view.gd | 9 +++++---- game/presentation/views/board_world.gd | 2 +- game/smoke/ui_input_probe.gd | 11 ++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/game/presentation/views/board_view.gd b/game/presentation/views/board_view.gd index 34c30961..aa78e702 100644 --- a/game/presentation/views/board_view.gd +++ b/game/presentation/views/board_view.gd @@ -60,8 +60,9 @@ const HERO_FRAME_PX := 32.0 # 英雄帧画布边长(素材 32×32 锁定— const HERO_SPRITE_SCALE := 1.5 # 1.5× 档(2026-09-26 用户二裁:实机看 1× 偏小放大 1.5 倍——明示 # 裁决压圣经 §8.2「禁非整数缩放」一般规则,§8.2 豁免注记归 art-bible # 批另落;头可越格上沿不裁剪) -const HERO_GROUND_FRAC := 0.75 # 脚锚纵向落点 = 格高 75%(自格顶起;即「脚在格子 1/4 处」自底边量—— - # 2026-09-26 用户裁决:不完全居中、脚踩 1/4 线,头越上格沿造立体感) +const HERO_GROUND_FRAC := 0.25 # 脚锚纵向落点 = 格底往上 25%(用户口径「脚踩格子 1/4 处·从下往上数」; + # 头越上格沿造立体感。⚠ 参照系纪律:本值一律自底边起算——上一批用 + # 「自顶 75%」表述同线异名,措辞口径误导用户被纠,本批统一为自底边) const HERO_MOVE_S := 0.14 # 位移时长(~140ms) const HERO_STEP_S := 0.18 # 走路帧周期 = 原地撞墙帧闪时长(~180ms) const HERO_DIG_S := 0.15 # 挖掘弹跳总时长(~150ms,半程压半程回) @@ -345,10 +346,10 @@ func cell_origin(c: Vector2i) -> Vector2: # 英雄脚底锚点——**世界坐标**(精灵在 SubViewport 世界内:格原点 = 格×步距,禁带壳层居中偏移。 # 2026-09-26 修正:上批误用壳层 cell_origin(含 _svp_container.position 居中偏移)定位世界内精灵, # 实测整体右偏 ~7 格+偏离格心——实机截图用户报缺陷)。 -# 纵向 = 格高 75% 线(脚踩格子 1/4 处·自底边量——2026-09-26 用户二裁);横向格中线。身体向上延伸, +# 纵向 = 格底往上 25% 线(脚踩格子 1/4 处——2026-09-26 用户裁决);横向格中线。身体向上延伸, # 头越上格沿不裁剪(立体感裁决);锚点与精灵缩放解耦(缩放只改身体向上长多少)。 func _hero_feet(c: Vector2i) -> Vector2: - return Vector2(c) * (_cell + float(SEP)) + Vector2(_cell * 0.5, _cell * HERO_GROUND_FRAC) + return Vector2(c) * (_cell + float(SEP)) + Vector2(_cell * 0.5, _cell * (1.0 - HERO_GROUND_FRAC)) # 英雄持握手位(fx 同层坐标系 = 壳层坐标——fx 在 SubViewport 之外,须含 _svp_container.position diff --git a/game/presentation/views/board_world.gd b/game/presentation/views/board_world.gd index fbdcff47..791c02a9 100644 --- a/game/presentation/views/board_world.gd +++ b/game/presentation/views/board_world.gd @@ -42,7 +42,7 @@ func ensure_hero(tex: Texture2D, shadow_px: Vector2, scale: float) -> Sprite2D: shadow.modulate = Color(0, 0, 0, 0.35) shadow.texture_filter = CanvasItem.TEXTURE_FILTER_LINEAR shadow.scale = shadow_px / (64.0 * scale) # 子件缩放叠父件 scale——目标屏幕尺寸 ÷ (纹理边 × 父档) - shadow.position = Vector2(0.0, 2.0) # 脚线下 2px——贴地接触感 + shadow.position = Vector2.ZERO # 椭圆中心 = 脚锚点(贴脚——上批 (0,2) 下坠让影子与脚脱开,用户报缺陷) shadow.z_index = -1 # 相对父件回落:格面(z=0 树序在先)之上、英雄本体之下 shadow.use_parent_material = true # 随英雄链世界去饱和材质 hero = Sprite2D.new() diff --git a/game/smoke/ui_input_probe.gd b/game/smoke/ui_input_probe.gd index eb26fa97..31f0661d 100644 --- a/game/smoke/ui_input_probe.gd +++ b/game/smoke/ui_input_probe.gd @@ -122,14 +122,15 @@ func _ready() -> void: if not ms.is_revealed(dig_t): _problems.append("case⑥ 核心揭格未落位(目标=%s)" % dig_t) # ---- case⑦ 英雄精灵世界落位(棋盘小人贴图批回归闸 2026-09-26):精灵在 SubViewport 世界内, - # 落位 = 格×步距 + 脚底锚(横=格中线/纵=格高 75% 线——2026-09-26 二裁「脚踩格子 1/4 处」; - # 禁带壳层 _svp_container.position 居中偏移——上批误用壳层 cell_origin 实测右偏 ~7 格+偏离 - # 格心,实机截图用户报缺陷)。素材缺位树(hero==null,字形「人」回退在役)跳过;断言前等 - # 0.3s 墙钟——headless 帧率无上限,帧数等待 < 位移 Tween 140ms 时会采到半途位置(首跑实证)。 ---- + # 落位 = 格×步距 + 脚底锚(横=格中线/纵=格底往上 25% 线=HERO_GROUND_FRAC 自底边口径——「脚踩 + # 格子 1/4 处·从下往上数」;禁带壳层 _svp_container.position 居中偏移——上批误用壳层 + # cell_origin 实测右偏 ~7 格+偏离格心,实机截图用户报缺陷)。素材缺位树(hero==null,字形 + # 「人」回退在役)跳过;断言前等 0.3s 墙钟——headless 帧率无上限,帧数等待 < 位移 Tween + # 140ms 时会采到半途位置(首跑实证)。 ---- if bv._world.hero != null: await get_tree().create_timer(0.3).timeout var expect: Vector2 = Vector2(ms.hero_pos()) * (bv.cell_size + float(bv.SEP)) \ - + Vector2(bv.cell_size * 0.5, bv.cell_size * bv.HERO_GROUND_FRAC) + + Vector2(bv.cell_size * 0.5, bv.cell_size * (1.0 - bv.HERO_GROUND_FRAC)) if bv._world.hero.position.distance_to(expect) > 0.5: _problems.append("case⑦ 英雄精灵世界落位偏移 pos=%s expect=%s" % [str(bv._world.hero.position), str(expect)]) if _problems.is_empty():