Code/Demos/AnimationShowcase/Components/ProgressBar.cs
using Goo;
using Sandbox.UI;
using static Sandbox.DemoTokens;
namespace Sandbox.AnimationShowcase;
public static class ProgressBar
{
public static Container Build( float width, float height, float t, Color color ) => new Container
{
Width = width,
Height = height,
BackgroundColor = Ink3,
BorderRadius = height / 2f,
Position = PositionMode.Relative,
Children =
{
new Container
{
Position = PositionMode.Absolute,
Left = 0f,
Top = 0f,
Width = width * t,
Height = height,
BorderRadius = height / 2f,
BackgroundColor = color,
PointerEvents = PointerEvents.None,
},
},
};
}