Interface IHudElementDefinition
One authored HUD element: where it sits, what it reads, and how it renders.
Inherited Members
Namespace: Serenity.GameUi.Domain.Interfaces
Assembly: Serenity.GameUi.Domain.dll
Syntax
public interface IHudElementDefinition : IFoundationSettings, IHudPlacedElement
Properties
Animations
The animations authored on this element, executed by the HUD's ProceduralAnimator runtime.
Declaration
IReadOnlyList<IHudElementAnimationDefinition> Animations { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<IHudElementAnimationDefinition> |
CapacityBinding
The binding that produces the maximum, for representations that need one. Null for representations that do not.
Declaration
IHudBinding CapacityBinding { get; }
Property Value
| Type | Description |
|---|---|
| IHudBinding |
Remarks
Stack, gauge and segmented representations are meaningless without a capacity: they cannot draw the
empty slots. Because Serenity's snapshots expose value and maximum side by side
(CurrentAmmo/MaxCapacity, RemainingHealth/MaxHealth), both bindings
normally share a source and differ only in their last step.
ChangeFeedbackCooldownSeconds
Minimum time between two change-feedback plays on this element, in seconds. Zero is a deliberate, expressible choice — play on every qualifying change — rather than "unset".
Declaration
float ChangeFeedbackCooldownSeconds { get; }
Property Value
| Type | Description |
|---|---|
| float |
ChangeFeedbackDefinitionId
The feedback definition to play when the bound value changes, referenced by id — never by a direct
asset reference, the same convention IFeedbackSettings.MenuTickDefinitionId uses. Empty turns
the feature off for this element.
Declaration
string ChangeFeedbackDefinitionId { get; }
Property Value
| Type | Description |
|---|---|
| string |
ChangeFeedbackDirection
Which direction of change plays ChangeFeedbackDefinitionId.
Declaration
HudValueChangeDirection ChangeFeedbackDirection { get; }
Property Value
| Type | Description |
|---|---|
| HudValueChangeDirection |
EvaluatesThresholdsAsCapacityRatio
Whether the threshold ramp evaluates against value ÷ capacity instead of the raw value.
Declaration
bool EvaluatesThresholdsAsCapacityRatio { get; }
Property Value
| Type | Description |
|---|---|
| bool |
GrowDirection
Which way a repeating representation extends from the anchor.
Declaration
HudGrowDirection GrowDirection { get; }
Property Value
| Type | Description |
|---|---|
| HudGrowDirection |
IsTranslatingLabel
Whether the caption is a localization key rather than literal text.
Declaration
bool IsTranslatingLabel { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Label
The optional caption drawn beside the value, or the whole text of a label element.
Declaration
string Label { get; }
Property Value
| Type | Description |
|---|---|
| string |
ParentId
The id of a FLEXBOX element this element is placed inside, or empty when it sits directly under the HUD's root.
Declaration
string ParentId { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
A parented element's Anchor and Offset stop applying — its parent's box
places it instead, the same way a CSS flex child ignores its own position.
PreviewCapacity
A maximum to stand in for the capacity binding while previewing, as text.
Declaration
string PreviewCapacity { get; }
Property Value
| Type | Description |
|---|---|
| string |
PreviewValue
A value to stand in for the binding while previewing, as text.
Declaration
string PreviewValue { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Authored, never invented. Choosing where a value comes from and choosing what to look at while laying the element out are two different decisions, and only the author can make the second one: a framework that guesses ends up encoding one game's specifics — six bullets, four of them spent — into everybody else's HUD. Empty means the preview shows exactly what the runtime would with no data, which is the truthful answer.
RefreshSignalTypeName
The assembly-qualified signal type that triggers a read when the trigger is ON_SIGNAL.
Declaration
string RefreshSignalTypeName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Representation
How the value is turned into something on screen.
Declaration
HudRepresentationKind Representation { get; }
Property Value
| Type | Description |
|---|---|
| HudRepresentationKind |
StartsHidden
Whether this element starts hidden, as if a HideHudElementSignal had already been processed
for it the moment the HUD was built.
Declaration
bool StartsHidden { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ThresholdUpperBounds
The threshold ramp's authored upper bounds, in ascending order — empty when no bands are authored.
Declaration
IReadOnlyList<double> ThresholdUpperBounds { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<double> |
Remarks
Colours stay Unity-side (UnityHudThresholdRamp, an Infrastructure type); this is the numeric
half the engine-agnostic scanner needs to validate a ramp without knowing what a Color is.
UpdateIntervalSeconds
Seconds between reads when the trigger is INTERVAL.
Declaration
float UpdateIntervalSeconds { get; }
Property Value
| Type | Description |
|---|---|
| float |
UpdateTrigger
What makes this element re-read its bindings.
Declaration
HudUpdateTrigger UpdateTrigger { get; }
Property Value
| Type | Description |
|---|---|
| HudUpdateTrigger |
ValueBinding
The binding that produces the displayed value.
Declaration
IHudBinding ValueBinding { get; }
Property Value
| Type | Description |
|---|---|
| IHudBinding |