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. |
| CornerRadius { get; set; } | Window bar corner radius in px of BOTH the track and the fill, so the fill is a rounded bar too. Default (framework 2.33.0): a radius larger than half the bar Height is drawn down-scaled so the bar never grows past its height (radius 2 on a 4 px bar = a capsule). Modern (framework 2.34.0): track, fill (with its FillGradient and Gloss baked in), Trail01 and a flat Overlay01 get rounded ends (radius capped at half the height); a striped overlay stays square. 0 (the default) = the unrounded bar of each style, unchanged. Init property (binary-compatible). |
| 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. |
| FillGlow { get; set; } | Modern (2.34.0): a soft glow of this colour around the main fill (follows its width; alpha = the glow’s peak). Radius GlowRadius. Null (default) = none. |
| FillGradient { get; set; } | Modern (2.34.0): a vertical gradient fill, top (At 0) → bottom (At 1), 2+ stops in order. Baked once at build into a small texture; Fill is then ignored and FillColorFn, when set, MULTIPLIES the gradient (return white or null for its own colours). Null or fewer than 2 stops (default) = the flat Fill, unchanged. |
| 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. |
| Gloss { get; set; } | Modern (2.34.0): a subtle static top gloss over the fill — white 18 % → 0 over the top third of the bar (not animated, unlike Sheen). Default false = none. |
| GlowRadius { get; set; } | Modern (2.34.0): how far FillGlow / OverlayGlow reach past the edge, px; 0 = 6. |
| 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. |
| LabelAlign { get; set; } | Modern (2.34.0): where the primary Label sits — Left (default, unchanged), Center or Right. |
| 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). |
| LabelInset { get; set; } | Modern (2.34.0): left/right inset of the overlay labels in px; 0 = 5 (unchanged). |
| LabelInside { get; set; } | When true, the label is overlaid centred ON the bar; false (default) keeps the beside-the-bar layout. |
| LabelOutline { get; set; } | Modern (2.34.0): give both overlay labels the dark readability outline (reads over any fill colour). Default false = unchanged. |
| 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. |
| OverlayGlow { get; set; } | Modern (2.34.0): a soft glow of this colour around the overlay segment. Null (default) = none. |
| 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. |
| OverlayStart01 { get; set; } | Modern (2.34.0): the overlay’s START fraction 0..1, re-pulled each refresh. With it the overlay is the segment [OverlayStart01, Overlay01] (e.g. a shield band right after the HP fill: start = hp/max, end = (hp+shield)/max) instead of [0, Overlay01]. Null (default) = starts at 0, unchanged. |
| OverlayStripeColor { get; set; } | Modern (2.34.0): draw the overlay as 135° diagonal stripes alternating OverlayColor and this colour (stripe width OverlayStripeWidth). Null (default) = a flat overlay, unchanged. |
| OverlayStripeWidth { get; set; } | Modern (2.34.0): width in px of each overlay stripe, measured across the stripe; 0 = 4. |
| 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. |
| SecondaryLabelColorFn { get; set; } | Modern (2.34.0): the SecondaryLabel colour, evaluated per refresh (e.g. a percent that turns red when low). Null Func or a null result = white, unchanged. |
| 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. |
| TickColor { get; set; } | Modern (2.34.0): divider colour of Ticks (alpha honoured). |
| Ticks { get; set; } | Modern (2.34.0): split the track into this many equal segments with N−1 thin dividers drawn over the fills and under the labels (10 = 10 % ticks; a wide TickWidth reads as a segmented gauge). Static, follow the bar width with no per-refresh work. 0/1 (default) = none; capped at 100. |
| TickWidth { get; set; } | Modern (2.34.0): divider width in px of Ticks; 0 = 1. |
| TrackColorFn { get; set; } | Window bar (framework 2.33.0; also honoured by Modern window bars since 2.34.0): track colour, evaluated per refresh and painted only when it changes (alpha honoured — e.g. a theme “track” token, or fully transparent over plugin frame art). Returning null keeps the default track. Default null → no override machinery, unchanged. Init property (binary-compatible). |
| Trail01 { get; set; } | Modern (2.34.0): a “damage trail” fraction 0..1, drawn BEHIND the main fill and the overlay (so only the part past the fill shows), re-pulled each refresh. The plugin owns the lag (hold, then ease down). Null (default) = none. Colour TrailColor. Independent of Overlay01, so both can show at once. |
| TrailColor { get; set; } | Modern (2.34.0): colour of the Trail01 band (alpha honoured). |
| 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