Code/Demos/RadialWheel/Components/Backdrop.cs
using Goo;
using Sandbox.UI;
using static Sandbox.DemoTokens;
namespace Sandbox.RadialWheel;
// Glassy inner disc behind the Center area. Smaller than the wheel; wedge gaps
// no longer reveal a dark ring. Blurs the game world that shows through the
// translucent wedges + center area.
public static class Backdrop
{
public static Container Build( float innerDiameterPx, float alpha, float blurPx, float highlightAlpha ) => new Container
{
Key = "backdrop",
Position = PositionMode.Absolute,
Top = Length.Percent( 50 ),
Left = Length.Percent( 50 ),
Width = innerDiameterPx,
Height = innerDiameterPx,
Transform = Goo.PanelTransform.Translate( -innerDiameterPx * 0.5f, -innerDiameterPx * 0.5f ),
PointerEvents = PointerEvents.None,
BackgroundColor = Ink1.WithAlpha( alpha ),
BackdropFilterBlur = blurPx,
BorderColor = FgPrimary.WithAlpha( highlightAlpha ),
BorderWidth = 1,
BorderTopLeftRadius = Length.Percent( 50 ),
BorderTopRightRadius = Length.Percent( 50 ),
BorderBottomLeftRadius = Length.Percent( 50 ),
BorderBottomRightRadius = Length.Percent( 50 ),
};
}