Skip to content

UIProgressBar Class

Definition

Namespace: Brine2D.UI

Progress bar UI component for displaying progress/percentage.

C#
public class UIProgressBar : Brine2D.UI.IUIComponent, Brine2D.UI.IAnchoredUIComponent

Inheritance System.Object → UIProgressBar

Implements IUIComponent, IAnchoredUIComponent

Properties
Anchor The screen anchor point this component is positioned relative to.
AnchorOffset Pixel offset from the resolved anchor point.
BackgroundColor Background color \(empty portion\).
BorderColor Border color.
BorderThickness Border thickness in pixels. Defaults to 2.
Direction Direction the bar fills.
FillColor Fill color \(filled portion\).
Font Optional font for rendering text \(null = renderer default\).
Label Optional label text \(e\.g\., "Health", "Loading"\).
LabelColor Label text color.
MaxValue Maximum value of the range. Defaults to 1. Setting this below MinValue is not supported.
MinValue Minimum value of the range. Defaults to 0.
PercentageFormat Format string for the progress text. The token {0} is replaced with the current percentage \(0–100\). Defaults to "{0:0}%". Ignored when ProgressTextProvider is set.
ProgressTextProvider Custom text provider for the progress label. Receives (currentValue, maxValue) and returns the display string. Overrides PercentageFormat when set.
ShowPercentage Whether to show percentage text.
TextColor Text color for percentage display.
Value Current value, clamped to [MinValue, MaxValue]. Setting this property fires OnValueChanged when the clamped value differs.
Methods
SetPercentage\(float\) Sets the value from a percentage \(0–100\), mapped onto [MinValue, MaxValue].
SetValue\(float\) Sets the value and fires OnValueChanged when the value differs. Equivalent to setting the Value property directly.
Events
OnValueChanged Event fired when value changes.