Class UnityHudIntegerPartRepresentation
Shows only the floored integer part of the bound value, discarding whatever comes after the decimal point — the large, slow-changing half of a value split across two elements, paired with UnityHudFractionPartRepresentation for the small, fast-ticking half.
Inheritance
Inherited Members
Namespace: Serenity.GameUi.Infrastructure.Representations
Assembly: Serenity.UnityGameUi.Infrastructure.dll
Syntax
public sealed class UnityHudIntegerPartRepresentation : UnityHudTextualRepresentation, IHudTextRepresentation, IHudRepresentation
Constructors
UnityHudIntegerPartRepresentation()
Declaration
public UnityHudIntegerPartRepresentation()
Properties
Kind
Declaration
public override HudRepresentationKind Kind { get; }
Property Value
| Type | Description |
|---|---|
| HudRepresentationKind |
Overrides
Methods
Configure(int, bool)
Configures the integer format. Used by the builder tool.
Declaration
public void Configure(int digits, bool grouped)
Parameters
| Type | Name | Description |
|---|---|---|
| int | digits | Minimum zero-padded digits. |
| bool | grouped | Whether to group thousands. |
FormatValue(CompiledHudBinding)
Renders the binding's current value as display text, or the binding's fallback when it cannot be read.
Declaration
public override string FormatValue(CompiledHudBinding binding)
Parameters
| Type | Name | Description |
|---|---|---|
| CompiledHudBinding | binding | The element's value binding. |
Returns
| Type | Description |
|---|---|
| string | The text to show. |
Overrides
Remarks
Always floors, never rounds: a value of 12.99 must read "12" for as long as it has not actually reached 13, the same guarantee UnityHudFractionPartRepresentation relies on to keep the two halves of a split value agreeing with each other. Floor also decides how a negative value reads — floor(-5.3) is -6, not -5 — which is what lets the fraction half stay a positive, paired remainder rather than a second sign to reconcile; see that class for the full reasoning.