Pause menu: icon sprites centred and untinted like SpriteIconButton

CenteredIcon draws its 15x15 sprite at x + 20/2 - 15/2 = x + 3 (integer
division), y + 3, with the widget's alpha only: Horizon drew it at +2
and tinted it grey.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-16 02:26:36 +02:00
parent d333780478
commit 8ca9cda5f6
+4 -9
View File
@@ -112,15 +112,10 @@ impl Game<'_> {
}
for (x, y, sprite) in pause_icons(w, h) {
ui::button(batch, atlas, x, y, 20.0, 20.0, &Text::empty(), false, false);
batch.sprite_scaled(
atlas,
sprite,
x + 2.0,
y + 2.0,
15.0,
15.0,
rgba(160, 160, 160, 255),
);
// SpriteIconButton.CenteredIcon: the 15x15 sprite at
// x + width / 2 - 15 / 2 in integer pixels, untinted even
// when the button is inactive.
batch.sprite_scaled(atlas, sprite, x + 3.0, y + 3.0, 15.0, 15.0, u32::MAX);
}
}
pub(super) fn pause_click(&mut self) -> Result<()> {