Frost translucent panels with glass

Panels whose background isn't solid draw the blurred game behind them,
cut to the same rounded rectangle texture as the background, where the
version supports glass. Panel screens then leave the rest of the game
unblurred.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-09-28 20:43:44 +02:00
co-authored by claude
parent 5c0912f0cf
commit 4d9c629eaf
5 changed files with 65 additions and 9 deletions
@@ -6,7 +6,8 @@ import org.saturnclient.ui.ElementContext;
import org.saturnclient.ui.RenderScope;
/**
* The translucent, outlined surface that screens lay their content on.
* The translucent, outlined surface that screens lay their content on,
* frosted over the game where glass is supported.
*/
public class Panel extends Element {
@@ -16,6 +17,11 @@ public class Panel extends Element {
}
public static void drawBackground(RenderScope renderScope, int width, int height) {
// Frosted behind a background that isn't solid
if (Theme.getPanelBg() >>> 24 < 0xFF) {
renderScope.drawGlass(0, 0, width, height, Theme.BG_RADIUS.value);
}
renderScope.drawRoundedRectangle(0, 0, width, height, Theme.BG_RADIUS.value, 1,
Theme.getPanelBg(), Theme.getBorder());
}