Fix Kush main menu background

It looked ok as long as the window had a 16:9 aspect ratio, however
default window size is 4:3 which squishes the balcony.

Add a horizontal alignment support for background layers, which allows
to fix this issue for any aspect ratio.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2026-07-05 18:12:48 +02:00
parent 173d768087
commit b588b62304
2 changed files with 16 additions and 1 deletions
@@ -29,6 +29,20 @@ class BackgroundLayer
"bottom": backgroundsSize.bottom
};
}
else if (this.layer.halign)
{
const left = ({
"left": 0.0,
"center": (backgroundsSize.right - width) / 2,
"right": backgroundsSize.right - width,
}[this.layer.halign] || 0.0) + offset;
this.background.size = {
"left": left,
"top": backgroundsSize.top,
"right": left + width,
"bottom": backgroundsSize.bottom
};
}
else
{
const right = backgroundsSize.right / 2 + offset;
@@ -59,7 +59,8 @@ export const backgrounds = {
{
"offset": (time, width) => -0.1,
"sprite": "background-kush1-4",
"tiling": true
"tiling": false,
"halign": "right"
}
],