Ending: place the 2P banner on the 2P lane (game_p2_y) #38

Merged
Yonokid merged 1 commits from GanYiZhong/YataiDONNijiiro:fix/2p-ending-lane-y into main 2026-09-29 16:49:52 +02:00
+6 -3
View File
@@ -5,7 +5,7 @@
-- Graphics/game/ending_<kind>_anim/s<c>.png -- one texture per shape
-- The clip plays once from frame 0 and then loops from `loop_at`, at 60 fps, on the
-- 1920x264 stage the original places at the lane (screen y 276 for 1P; the 2P
-- lane adds the skin's game_2p_offset). The engine keeps its own ending
-- lane is game_p2_y lower). The engine keeps its own ending
-- animation running for the sounds and hands the drawing to this object through
-- Background:handle_ending / draw_ending.
local Ending = {}
@@ -40,8 +40,11 @@ function Ending.new(kind, player_num, path)
self.t0 = nil
self.y = STAGE_Y
if player_num == 2 then
local off = tex.get_skin_config("game_2p_offset")
self.y = STAGE_Y + ((off and off.y) or 0)
-- the 2P lane sits at game_p2_y, the 1P lane at 184 (both x screen scale); game_2p_offset
-- (536) is not that distance and put the 2P banner below the screen
local p2 = tex.get_skin_config("game_p2_y")
local lane1 = 184 * tex.get_screen_scale()
self.y = STAGE_Y + ((p2 and p2.y) and (p2.y - lane1) or 0)
end
return self
end