dan game: soul gauge drawn as on the cabinet #66

Merged
GanYiZhong merged 5 commits from GanYiZhong/YataiDONNijiiro:fix/dan-game-gauge into main 2026-10-14 15:38:18 +02:00
2 changed files with 7 additions and 6 deletions
Showing only changes of commit 97fa82924f - Show all commits

No files matched your search

Binary file not shown.
+5 -4
View File
@@ -13,15 +13,16 @@ local LABEL_SIZE = 30 -- arcade MS 明朝 36; ours reads
local WHITE = { 255, 255, 255, 255 } local WHITE = { 255, 255, 255, 255 }
local BLACK = { 0, 0, 0, 255 } local BLACK = { 0, 0, 0, 255 }
local PLATE_W, PLATE_H = 586, 60 local PLATE_W, PLATE_H = 586, 60 -- the plate's grey body; the art adds a 9 px margin
local PLATE_ART_PAD = 9 -- (the pill's top/left edge and the drop shadow)
local PLATE_GAP = 12 -- px between the plate's bottom and the bar top local PLATE_GAP = 12 -- px between the plate's bottom and the bar top
local PLATE_OVERHANG = 24 -- px the plate extends PAST the threshold local PLATE_OVERHANG = 24 -- px the plate extends PAST the threshold
local PILL_CX, PILL_CY = 150, 20 -- 魂ゲージ ink centre, plate-local local PILL_CX, PILL_CY = 150, 20 -- 魂ゲージ ink centre, plate-local
local VALUE_RIGHT = 532 -- 100%以上 is RIGHT-aligned to this local VALUE_RIGHT = 532 -- 100%以上 is RIGHT-aligned to this
local VALUE_CY = 39 -- its ink centre y, plate-local local VALUE_CY = 35 -- its ink centre y, plate-local
local NAME_SIZE = 26 -- arcade id 142 local NAME_SIZE = 26 -- arcade id 142
local VALUE_SIZE = 30 -- arcade id 141 local VALUE_SIZE = 36 -- arcade id 141
-- the threshold marker (gauge_border_cell): its white inside (x 7, y 7 in the art) lands on -- the threshold marker (gauge_border_cell): its white inside (x 7, y 7 in the art) lands on
-- the threshold cell's left edge + 1, from y 238, as the cabinet's border_N -- the threshold cell's left edge + 1, from y 238, as the cabinet's border_N
@@ -103,7 +104,7 @@ function M:draw()
local px = math.max(0, math.floor(x - PLATE_W + PLATE_OVERHANG + 0.5)) local px = math.max(0, math.floor(x - PLATE_W + PLATE_OVERHANG + 0.5))
local py = GAUGE_Y - PLATE_GAP - PLATE_H local py = GAUGE_Y - PLATE_GAP - PLATE_H
if pid then if pid then
tex.draw_texture(pid, { x = px, y = py }) tex.draw_texture(pid, { x = px - PLATE_ART_PAD, y = py - PLATE_ART_PAD })
end end
-- fail soft: with no plate art the two captions still draw, at the same places -- fail soft: with no plate art the two captions still draw, at the same places