ResourceHandle
A resource as defineResource returns it: its name, which the dump,
the devtools and a save show it under, and its settings, filled. A
value that touches no world: a world installs it from
resources({ kinds }) or registerResource.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”| Property | Modifier | Type | Description |
|---|---|---|---|
name |
readonly |
string |
- |
settings |
readonly |
object |
- |
settings.color? |
readonly |
string |
The fill every bar draws it in, such as "#4aa3ff": any CSS colour. One bar may draw it in another. Left out, a bar draws in Bar’s own fill. |
settings.label |
readonly |
string |
What a player reads for it, such as "Mana": a bar’s name and a refused cast’s line. Left out, it is the name as words: "Combo" for "combo", "Lantern charges" for "lanternCharges". |
settings.maximum |
readonly |
number |
What it holds when full: the base of the character’s max<Name> stat, maxMana for "mana", which items and cards raise. |
settings.regen |
readonly |
number |
What it gains a second, up to its maximum; a negative regen decays it toward 0, as rage does. A character’s <name>Regen stat, where it has one, takes its place. Left out, it never regenerates. |
settings.regenDelaySeconds? |
readonly |
number |
Seconds it stops regenerating after a spend, as stamina does. Left out, it regenerates at once. |
settings.saved? |
readonly |
boolean |
Whether a save keeps what a character has of it. False leaves it out, and a load starts it from start, as a game that refills it on each load wants. Left out, it is saved. |
settings.start |
readonly |
number | "empty" | "full" | Full | Empty |
Where it starts when a character is given it: full, empty, or a number, capped at maximum. Its text too, so "full" reads as the enum does. |