Skip to content

Commit 529ba57

Browse files
committed
platformer: fix the card backdrop seam (one cover-fill panel, not two stretches)
The illustrated-card backdrop stitched two copies of the same biome frame stretched to fixed widths (0-592 and 432-1024); in their overlap each showed a different part of the frame, so they did not line up. Replace them with ONE panel scaled to COVER the card width with its aspect kept (the overflow below the 640 card height is cropped by the window, and the card's ground band hides the cropped foreground). A single image has no join, so a seam is impossible - and the uniform scale means no distortion either. Example-side only. Static gates + audit clean. Needs an OXT pass to confirm. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HkN9P6YodA65ZuhDDuuQks
1 parent f8ac20d commit 529ba57

1 file changed

Lines changed: 22 additions & 18 deletions

File tree

examples/box2dxt-platformer.livecodescript

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -955,32 +955,36 @@ end pfCardCastMember
955955
-- blendLevel so the fade ramp can add progress on top without flattening the
956956
-- scrim/ground translucency.
957957
command pfCardArtBuildLevel
958-
local tBg, tGY
958+
local tBg, tGY, tBW, tBH, tBgH
959959
if gAssetsOK is not true then exit pfCardArtBuildLevel -- placeholder mode: tint card only
960960
put 480 into tGY -- the ground line the cast stands on
961-
-- the biome backdrop (L1-L5), as two overlapping panels filling the 1024 width
961+
-- the biome backdrop (L1-L5): ONE panel scaled to COVER the 1024 card width with
962+
-- its aspect KEPT (the overflow below the 640 card height is simply cropped by
963+
-- the window). A single image has no join, so there is no seam to misalign - the
964+
-- earlier two-panel stretch mismatched in its overlap. The card's ground band
965+
-- hides the cropped-off foreground.
962966
put pfLevelBgFrame(gLevel) into tBg
963967
if tBg is not empty and b2kSheetHasFrame("bg", tBg) then
964968
if pfCardArtImage("bg", tBg, "pfCardBgA") is not empty then
965-
set the rect of image "pfCardBgA" to 0, 0, 592, 640
969+
put the width of image "pfCardBgA" into tBW -- natural sliced size (~640x640 at bg scale 2.5)
970+
put the height of image "pfCardBgA" into tBH
971+
if tBW < 1 then put 640 into tBW
972+
if tBH < 1 then put 640 into tBH
973+
put max(640, round(1024 * tBH / tBW)) into tBgH -- aspect-scaled to fill the width (>= card height)
974+
set the rect of image "pfCardBgA" to 0, 0, 1024, tBgH
966975
set the uCardBaseBlend of image "pfCardBgA" to 0
967976
pfCardAddArt the long id of image "pfCardBgA"
977+
-- a dark scrim so the title text reads over the busy backdrop (rests at 42)
978+
create graphic "pfCardScrim"
979+
set the style of graphic "pfCardScrim" to "rectangle"
980+
set the rect of graphic "pfCardScrim" to 0, 0, 1024, 640
981+
set the filled of graphic "pfCardScrim" to true
982+
set the backgroundColor of graphic "pfCardScrim" to "14,16,26"
983+
set the blendLevel of graphic "pfCardScrim" to 42
984+
set the uCardBaseBlend of graphic "pfCardScrim" to 42
985+
set the visible of graphic "pfCardScrim" to false -- hidden until pfCardShow reveals the whole cover at once
986+
pfCardAddArt the long id of graphic "pfCardScrim"
968987
end if
969-
if pfCardArtImage("bg", tBg, "pfCardBgB") is not empty then
970-
set the rect of image "pfCardBgB" to 432, 0, 1024, 640
971-
set the uCardBaseBlend of image "pfCardBgB" to 0
972-
pfCardAddArt the long id of image "pfCardBgB"
973-
end if
974-
-- a dark scrim so the title text reads over the busy backdrop (rests at 42)
975-
create graphic "pfCardScrim"
976-
set the style of graphic "pfCardScrim" to "rectangle"
977-
set the rect of graphic "pfCardScrim" to 0, 0, 1024, 640
978-
set the filled of graphic "pfCardScrim" to true
979-
set the backgroundColor of graphic "pfCardScrim" to "14,16,26"
980-
set the blendLevel of graphic "pfCardScrim" to 42
981-
set the uCardBaseBlend of graphic "pfCardScrim" to 42
982-
set the visible of graphic "pfCardScrim" to false -- hidden until pfCardShow reveals the whole cover at once
983-
pfCardAddArt the long id of graphic "pfCardScrim"
984988
end if
985989
-- a ground band the cast stands on (a darker shade of the biome tint)
986990
create graphic "pfCardGround"

0 commit comments

Comments
 (0)