Skip to content

BattleUnitWorldBar

BattleUnitWorldBar

World-space unit chrome — segmented HP, AP pips, ally/enemy tint, optional predamage threat, tooltip identity.

Package

SusGame · HUD (commercial)

Open in Playground

SusGame · HUD

Props

NameTypeDefault
UnitNameProp<string>""v-model
RankProp<string>""v-model
DescriptionProp<string>""v-model
PositionLabelProp<string>""v-model
TipExtraProp<string>""v-model
CurrentHpProp<int>10v-model
MaxHpProp<int>10v-model
CurrentApProp<int>2v-model
MaxApProp<int>2v-model
PredamageMinProp<int>0v-model
PredamageAccuracyProp<int>0v-model
PredamageProp<bool>falsev-model
AllyProp<bool>truev-model
BarActiveProp<bool>truev-model
EntityIdProp<int>-1v-model
DisplayNameProp<string>""
HpTextProp<string>"0"

Slots

No slots.

Events

No public events.

Style hooks

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

  • battle-unit-world-bar
  • battle-unit-world-bar__ap-pip
  • battle-unit-world-bar__ap-pip--active
  • battle-unit-world-bar__ap-pip--hidden
  • battle-unit-world-bar__ap-pip--spent
  • battle-unit-world-bar__ap-row
  • battle-unit-world-bar__ap-spacer
  • battle-unit-world-bar__content
  • battle-unit-world-bar__counter
  • battle-unit-world-bar__counter-label
  • battle-unit-world-bar__hp-row
  • battle-unit-world-bar__hp-seg
  • battle-unit-world-bar__hp-seg--empty
  • battle-unit-world-bar__hp-seg--filled
  • battle-unit-world-bar__hp-seg--hidden
  • battle-unit-world-bar__hp-seg--spent
  • battle-unit-world-bar__hp-seg--threat
  • battle-unit-world-bar__hp-seg-fill
  • battle-unit-world-bar__main
  • battle-unit-world-bar__name
  • battle-unit-world-bar__row
  • battle-unit-world-bar__statuses
  • battle-unit-world-bar__statuses--hidden
  • battle-unit-world-bar__tip
  • battle-unit-world-bar--ally
  • battle-unit-world-bar--enemy
  • battle-unit-world-bar--inactive
  • battle-unit-world-bar--predamage
  • sus-icon
  • sus-status-effect
  • sus-status-effect__icon

Usage

csharp
var bar = new BattleUnitWorldBar();
bar.UnitName.Value = "Ranger";
bar.Rank.Value = "Sgt";
bar.Ally.Value = true;
bar.CurrentHp.Value = 7;
bar.MaxHp.Value = 10;
bar.CurrentAp.Value = 2;
bar.MaxAp.Value = 3;
bar.BarActive.Value = true;
bar.Init(wounds: 10, actionPoints: 3);
bar.ShowPredamage(minDamage: 2, accuracy: 75);
xml
<template>
  <sus:BattleUnitWorldBar :UnitName="Name.Value"
                          :Rank="Rank.Value"
                          :Description="Desc.Value"
                          :PositionLabel="Pos.Value"
                          :CurrentHp="Hp.Value"
                          :MaxHp="HpMax.Value"
                          :CurrentAp="Ap.Value"
                          :MaxAp="ApMax.Value"
                          :Ally="Ally.Value"
                          :BarActive="Active.Value"
                          :Predamage="Threat.Value"
                          :PredamageMin="ThreatMin.Value"
                          :PredamageAccuracy="ThreatAcc.Value"
                          :EntityId="Entity.Value" />
</template>

<script>
public Prop<string> Name = new("Ranger");
public Prop<string> Rank = new("Sgt");
public Prop<string> Desc = new("Scout · medium armor");
public Prop<string> Pos = new("A3");
public Prop<int> Hp = new(7);
public Prop<int> HpMax = new(10);
public Prop<int> Ap = new(2);
public Prop<int> ApMax = new(3);
public Prop<bool> Ally = new(true);
public Prop<bool> Active = new(true);
public Prop<bool> Threat = new(false);
public Prop<int> ThreatMin = new(0);
public Prop<int> ThreatAcc = new(0);
public Prop<int> Entity = new(-1);
</script>
Prop / APIRole
UnitName · Rank · DescriptionIdentity / tooltip
PositionLabel · TipExtraExtra tooltip lines
CurrentHp / MaxHpWound segments (1:1)
CurrentAp / MaxApAP pips (≤8)
AllyAlly vs enemy chrome
BarActiveInactive / dimmed
Predamage*Threat overlay on HP
EntityIdHost / ECS bridge id
Init / ResolveDamage / SpendActionCombat helpers
ShowPredamage / ResetHealthVisualThreat + visual reset

Notes

  • DisplayName and HpText are derived — bind the source props above, not those two.
  • One HP segment per wound point (not a padded 10-seg strip when MaxHp differs).
  • Prefer kit SusHealthBar / SusUnitNameplate for simpler world labels; this bar is the tactical segmented variant.