Skip to content

SusHealthBar

SusHealthBar

Animated HP fill (0…1) with optional percent label and healthy / warning / critical thresholds.

Package

SusKit · World (commercial)

Open in Playground

SusKit · World

Props

NameTypeDefault
ValueProp<float>1f
ShowLabelProp<bool>true

Slots

No slots.

Events

No public events.

Style hooks

USS class contract — override appearance without touching C#. States toggle via these classes:

  • hb-fill
  • hb-label
  • sus-healthbar
  • sus-healthbar--critical
  • sus-healthbar--healthy
  • sus-healthbar--warning

Usage

csharp
var hp = new SusHealthBar();
hp.Value.Value = 0.72f;
hp.ShowLabel.Value = true;
xml
<template>
  <sus:SusHealthBar :Value="Hp.Value"
                    :ShowLabel="ShowLabel.Value" />
</template>

<script>
public Prop<float> Hp = new(0.72f);
public Prop<bool> ShowLabel = new(true);
</script>
PropRole
ValueFraction 0…1 (clamped visually)
ShowLabelPercent text over the bar

Notes

  • Threshold classes: healthy / warning / critical (driven from Value).
  • Fill animates toward the new value (~0.4s); update Value from combat ticks.