Update screenshots, and visual styling in games

This commit is contained in:
James Babcock committed 2026-10-03 16:51:17 -07:00
1 parent ad60494c98
commit 42555bf213
12 files changed
+77 -10

No files matched your search

+16 -2
View File
@@ -63,6 +63,12 @@ const TOP = 4;
const BOTTOM = 256;
const LANE_X = 232;
const PANEL_X = 310;
/**
* Height the table and panel are drawn for: a min-height window's viewport
* under the standard top bar. A taller viewport (the status bar folded into
* the switcher row, a full-panel display) centers the layout vertically.
*/
const LAYOUT_HEIGHT = 260;
const BALL_R = 6;
/** Ball resting spot on the plunger, and where launches start. */
@@ -894,8 +900,8 @@ let staticBackground: GrayImage | null = null;
/** Everything that never changes: walls, guides, slings, outlines, labels. */
function getStaticBackground(window: PinballWindow): GrayImage {
if (staticBackground) return staticBackground;
const image = new GrayImage(window.viewportWidth, window.viewportHeight, 0);
if (staticBackground?.width === window.viewportWidth) return staticBackground;
const image = new GrayImage(window.viewportWidth, LAYOUT_HEIGHT, 0);
for (const segment of SEGMENTS) {
image.drawLine(segment.x0, segment.y0, segment.x1, segment.y1, segment.shade);
}
@@ -995,6 +1001,14 @@ function paintContent(window: PinballWindow): GrayImage {
`${GESTURE_CLICK} new game`,
]);
}
return centeredInViewport(window, image);
}
/** Place the fixed-height layout vertically centered in the window's viewport. */
function centeredInViewport(window: PinballWindow, layout: GrayImage): GrayImage {
if (layout.height === window.viewportHeight) return layout;
const image = new GrayImage(window.viewportWidth, window.viewportHeight, 0);
layout.composeInto(image, 0, Math.max(0, Math.floor((window.viewportHeight - layout.height) / 2)));
return image;
}