Interface IHudValueColorable
A renderer that can be recoloured by a HUD element's threshold ramp, independently of a value change.
Namespace: Serenity.GameUi.Infrastructure.Representations
Assembly: Serenity.UnityGameUi.Infrastructure.dll
Syntax
public interface IHudValueColorable
Remarks
Deliberately a separate, additive interface rather than another parameter on Apply(CompiledHudBinding, CompiledHudBinding).
Every renderer caches its last rendered output and early-returns once nothing changed —
HudTextRepresentationRenderer's _lastRendered string is the example — which is exactly
what makes a per-frame HUD affordable. Routing a colour-only change through Apply would be swallowed
by that same cache the moment the bound value itself has not moved: a health value can sit still while its
ratio crosses a band boundary through capacity alone, and the text would never repaint. A renderer that
supports threshold colour implements this separately, so a band change always lands whether or not the
value did.
Methods
ApplyValueColor(Color)
Colours the representation's value for as long as it stays in its current threshold band.
Declaration
void ApplyValueColor(Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | The band's authored colour. |
ClearValueColor()
Restores whatever colour the representation had before any threshold band applied.
Declaration
void ClearValueColor()