progress_bar
A horizontal progress bar — health, mana, loading state, voting tally. Reads the current value from screen.data[value_key] and renders it as a fraction. The maximum can be a literal (max_value) or another data key (max_key); if both are set, max_key wins.
Display only.
C# factory
WidgetDefinitions.ProgressBar( id: "health", valueKey: "hp", maxValue: 100, positionX: 0.5f, positionY: 0.05f, sizeW: 0.8f, sizeH: 0.04f, color: "#ef4444", label: "{hp}/100");Wire format
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
type | "progress_bar" | yes | |
position_x, position_y, size_w, size_h | number | no | 0..1 anchor + size. |
value_key | string | yes | Data key for current value. |
max_key | string | no | Data key for max. Wins over max_value if both are set. |
max_value | number | no | Literal max. Used when max_key is absent. |
color | string | no | Fill color. |
label | string | no | Optional caption above the bar. Supports {key} bindings. |
Events
Display only.
Example
// Push HP changes — the bar animates on every connected phone.manager.UpdateScreenDataForAll("game", new { hp = currentHp });