BarElement record
Graphical fill bar (0..1). Chrome framework-themed; Fill is the plugin’s semantic colour (from its colour slot). Optional right-aligned numeric Label and optional fixed-width left Prefix caption (e.g. “HP” / “Stamina”) so stacked bars align in a column.
public record BarElement : IEquatable<HudElement>Public Members
Section titled “Public Members”| name | description |
|---|---|
| BarElement(…) | Graphical fill bar (0..1). Chrome framework-themed; Fill is the plugin’s semantic colour (from its colour slot). Optional right-aligned numeric Label and optional fixed-width left Prefix caption (e.g. “HP” / “Stamina”) so stacked bars align in a column. |
| Fill { get; set; } | Semantic fill colour (from the plugin’s colour slot). |
| FillColorFn { get; set; } | Modern fill colour, evaluated PER REFRESH so it can track which item occupies a reused/pooled row slot — the static Fill ctor arg is captured once and cannot (e.g. the Nearby Monsters list colouring the HP fill by monster rank in the same recycled row). FillColorFn non-null wins; returning null falls back to the static Fill. Default null → unchanged; a Modern bar that leaves it null renders with the static Fill exactly as before, with no override machinery attached. Added as an init property (NOT a positional ctor param) so the record stays source + binary compatible with already-compiled plugins (see WindowBuilder-Patterns.md “Binary compatibility rules”). Honoured on the Modern path and the Default (window) bar path. |
| FillWidth { get; set; } | When true, the track flexes to fill the row width (overrides Width). |
| Fraction01 { get; set; } | Fill fraction 0..1, re-pulled each refresh. |
| Height { get; set; } | Bar thickness in px; 0 = framework default (14). |
| Label { get; set; } | Optional numeric/status text; right-aligned beside the bar, or centred on it when LabelInside is true. |
| LabelColor { get; set; } | Bar label colour; null (default) = the theme’s muted text colour. |
| LabelColorFn { get; set; } | Modern primary (left/inside) label colour, evaluated PER REFRESH so it can track which item occupies a reused/pooled row slot — the static LabelColor is captured once and cannot (e.g. the Nearby Monsters list colouring a boss name red vs. an elite yellow in the same recycled row). Returning null falls back to LabelColor if set, else today’s default (white). Default null → unchanged; a Modern bar that sets neither renders the plain white overlay exactly as before. Added as an init property (NOT a ctor param) so the record stays source + binary compatible with already-compiled plugins (see WindowBuilder-Patterns.md “Binary compatibility rules”). Honoured only on the Modern path; the Default bar path keeps using the static LabelColor. |
| LabelFontSize { get; set; } | Label/prefix font size in px; 0 = framework default (12). |
| LabelInside { get; set; } | When true, the label is overlaid centred ON the bar; false (default) keeps the beside-the-bar layout. |
| Overlay01 { get; set; } | Modern only: optional SECOND fill fraction 0..1 drawn on the SAME track as Fraction01, re-pulled each refresh. Null (default) = no overlay → bar renders unchanged. Pair with OverlayColor and OverlayInFront to show a second value (e.g. a monster shield on an HP bar). Ignored in Default. |
| OverlayColor { get; set; } | Modern only: colour of the Overlay01 fill. Include an alpha < 1 for a translucent band (typical when OverlayInFront is true). Ignored when Overlay01 is null or in Default. |
| OverlayInFront { get; set; } | Modern only: draw order of the Overlay01 fill relative to the main fill. true = draw OVER the main fill (a translucent band layered on top — e.g. a shield tint over HP). false (default) = draw BEHIND the main fill so the opaque main fill covers it, leaving only the excess visible as an “extension cap” past the main fill (e.g. Overlay01 = (hp+shield)/max shows the shield as extra length). Ignored when Overlay01 is null or in Default. |
| Prefix { get; set; } | Optional fixed-width left caption (e.g. “HP”) so stacked bars align in a column. |
| SecondaryLabel { get; set; } | Modern only: right-edge text (e.g. a running total); Label is then the left/primary text. Ignored in Default. |
| Sheen { get; set; } | Modern only: an animated soft-white sheen band that sweeps across the fill. Default false. Ignored in Default. |
| Style { get; set; } | Visual style. Default (0) = today’s rounded-pill render; Modern = the CombatMeter metric-bar look (flat translucent track + flat role-coloured anchor-clipped fill + dual left/right overlay text). Existing bars omit it → render unchanged. |
| Width { get; set; } | Fixed track width in px; 0 = framework default (150). Ignored when FillWidth is true. |
See Also
Section titled “See Also”- record HudElement
- namespace Stellar.Abstractions.Services