Skip to content
smartargs
VantageDocumentation

UI reference

The components that set up a screen, the icon set asset, the bases for your own HUD panels and windows, the presenters that read units for them, and the theme, icon and tooltip API. For how to use it, see UI.

VtUiRoot

Component. Add it with Add Component → Vantage → UI → VtUiRoot. Adds UIDocument automatically.

The root of a screen’s UI: six layers in a fixed order on the UI Document, so nameplates stay under the HUD, windows over it, menus over windows, dialogs and toasts over menus, and the tooltip in front of everything, whichever order components add themselves in. Every layer fills the screen and ignores the pointer itself, so clicks between panels reach the game.

Scripting API

Member Description
static VtUiRoot Current { get; } The root in the loaded scene, or null. Cached until it goes away.
bool IsBuilt { get; } Whether the layers exist on the UI Document’s current root.
event Action RootRebuilt Fires after the UI Document rebuilt its root and the layers were built again. Anything added to a layer before is gone; add it again here.
const string LayerUssClassName Class on every layer.
const string LayersUssClassName Class on the element holding the six layers.
const string RegionUssClassName Class on every region.
static string ClassName(VtUiLayer value) The class for value, such as vt-layer--hud.
static string ClassName(VtUiRegion value) The class for value, such as vt-region--top-left.
VisualElement Layer(VtUiLayer value) The element for value, or null while the UI Document has no panel settings.
VisualElement Region(VtUiRegion value) The element for value on the HUD layer, created on first use, or null while the UI Document has no panel settings. Children stack in a column; top regions stack down, bottom ones up.

VtUiNavigation

Component. Add it with Add Component → Vantage → UI → VtUiNavigation.

The stack of open screens: windows, menus and dialogs. Push a screen to open it on top, and the Cancel input, Esc or the gamepad’s east button, pops the top one, so every window closes the same way. While anything is open the player’s gameplay input is held, so a key that opens a bag does not also cast, and focus moves to the screen that just opened and back to the one below when it closes.

Inspector fields

Field Type Default Description
Block Gameplay While Open (blockGameplayWhileOpen) bool On Hold the player’s gameplay input (hotkeys, orders, selection, click-to-move) while a screen is open.
Hide Cursor On Gamepad (hideCursorOnGamepad) bool Off Hide the mouse cursor while a screen is open and the player is on a gamepad.

Scripting API

Member Description
static VtUiNavigation Current { get; } The navigation in the loaded scene, or null.
VisualElement Top { get; } The screen on top, or null.
int Depth { get; } How many screens are open.
bool IsOpen { get; } Whether any screen is open.
bool BlockGameplayWhileOpen { get; set; } Whether gameplay input is held while a screen is open.
event Action Changed Fires after a screen was pushed or popped.
bool Contains(VisualElement screen) Whether screen is somewhere on the stack.
void Push(VisualElement screen) Open screen on top. A screen already on the stack moves to the top. A VtWindow is opened; a VtDialog is left as it is, since VtDialog.Show shows it.
void Open(VtWindow window, VtUiLayer layer = VtUiLayer.Windows) Put window on layer of the root when it has no parent yet, then push it.
bool Pop() Close the top screen. False when nothing is open or the top is a blocking dialog.
bool Close(VisualElement screen) Close screen wherever it is on the stack. False when it is not open.
void Toggle(VtWindow window) Open window when it is closed, close it when it is open.
void Clear() Close every screen, bottom to top.

VtTooltipHost

Component. Add it with Add Component → Vantage → UI → VtTooltipHost.

Puts the screen’s one VtTooltip on the tooltip layer of the VtUiRoot and hands it to VtTooltips.Host, so every element attached with VtTooltips.Attach shows its tooltip there. Add it next to the root; without it tooltips are silently off.

Inspector fields

Field Type Default Range Description
Delay Ms (delayMs) int 400 ≥ 0 Milliseconds the pointer or the focus rests on an element before its tooltip shows.

Scripting API

Member Description
VtTooltip Tooltip { get; } The tooltip element, or null before it is built.

VtMapArea

Component. Add it with Add Component → Vantage → UI → VtMapArea.

A stretch of ground a minimap can draw, read through VtMinimapPresenter: its size on the XZ plane around this object, the picture of it and the name the minimap shows while the player is inside.

Inspector fields

General

Field Type Default Range Description
Size (size) Vector2 (64, 64) Width (world X) and depth (world Z) of the area in metres, centred on this object.
Image (image) Texture2D None Top-down picture of the area with north up. Empty draws the minimap’s plain background.
Display Name (displayName) string Empty The area’s name on the minimap, a localization key or plain text. Empty shows no name.

Capture

Field Type Default Range Description
Capture Resolution (captureResolution) int 1024 128 to 4096 Width in pixels of a captured image; the height follows the area’s proportions.
Capture Layers (captureLayers) LayerMask Everything Layers the capture camera renders.
Capture Background (captureBackground) Color #17171CFF Colour where the capture sees nothing.
Capture Without Units (captureWithoutUnits) bool On Leave units out of the capture, so the picture shows the ground and not who stood on it.

Scripting API

Member Description
static IReadOnlyList<VtMapArea> All { get; } Every enabled area.
Vector2 Size { get; set; } Width (world X) and depth (world Z) in metres.
Texture2D Image { get; set; } The top-down picture, north up, or null.
string DisplayName { get; set; } The area’s name, a localization key or plain text.
int CaptureResolution { get; set; } Width in pixels of a captured image.
Rect WorldRect { get; } The area on the XZ plane: x/y are the world X and Z of its minimum corner.
bool Contains(Vector3 world) Whether world lies inside the area, ignoring height.
static VtMapArea Find(Vector3 world) The smallest enabled area holding world, or null.
Texture2D Capture() Render the area from straight above into a new texture, CaptureResolution wide, with the capture settings of this area. The caller owns the texture. Set it as Image to use it.

VtMapMarker

Component. Add it with Add Component → Vantage → UI → VtMapMarker.

Puts an icon on the minimap at this object, read through VtMinimapPresenter: a vendor, a dungeon entrance, a waypoint. On a unit it replaces the unit’s dot.

Inspector fields

Field Type Default Description
Icon (icon) string "map-pin" Icon id from the icon set, such as store, flag or house.
Tint (tint) VtMapMarkerTint Foreground Colour of the icon.
Reveal (reveal) VtMapMarkerReveal WhenExplored When the marker shows through the fog of war.
Pin To Edge (pinToEdge) bool Off Keep the marker on the rim of the minimap while it is out of range, pointing the way.

Scripting API

Member Description
static IReadOnlyList<VtMapMarker> All { get; } Every enabled marker.
string Icon { get; set; } Icon id from the icon set.
VtMapMarkerTint Tint { get; set; } Colour of the icon.
VtMapMarkerReveal Reveal { get; set; } When the marker shows through the fog of war.
bool PinToEdge { get; set; } Whether the marker stays on the rim of the minimap while out of range.

VtIconSet

Asset. Create it with Create → Vantage → UI → Icon Set.

The icons the UI refers to by id. The package ships one with the Lucide glyphs that its own components use; VtIcons looks ids up there. Make your own set for extra icons and install it with VtIcons.Install; set fallback to the shipped set, or leave it empty, and ids your set lacks still resolve through the shipped one.

Inspector fields

Field Type Default Description
Fallback (fallback) VtIconSet None Looked up for ids this set does not have.
Entries (entries) VtIconEntry[] Empty One row per icon.

Scripting API

Member Description
int Count { get; } How many icons this set holds, without its fallback.
bool TryGet(string id, out Background background) The image for id from this set or its fallbacks. False when no set has it.
bool Contains(string id) Whether this set, or a fallback, has an icon called id.
void Rebuild() Rebuild the lookup after editing entries at runtime.

VtHudPanel

Abstract component base.

Base of every HUD controller: builds its element once, puts it in a region of the VtUiRoot on the same object, or the scene’s root, and builds it again when the UI Document rebuilds its root. Subclasses build in Build and refresh in Refresh, which runs every frame while the panel is shown.

Inspector fields

Field Type Description
Region (region) VtUiRegion Where on the HUD the panel sits.
Order (order) int Where the panel sits among the others in its region: lower first, from the top of the region down. Panels with the same order keep the order they were built in.
Layout (layout) VisualTreeAsset A UXML layout of your own for this panel, with the same part names as the shipped one. Empty uses the shipped layout.

Scripting API

Member Description
VtUiRegion Region { get; set; } Where on the HUD the panel sits. Changing it moves the panel.
int Order { get; set; } Where the panel sits among the others in its region: lower first, from the top of the region down. Panels with the same order keep the order they were built in. Changing it moves the panel.
VisualTreeAsset Layout { get; set; } A UXML layout of your own for this panel, with the same part names as the shipped one. Null uses the shipped layout. Changing it builds the panel again.
protected virtual string DefaultLayout { get; } The name of the shipped layout under Resources/VtLayouts, or null for a panel built in code.
VisualElement Element { get; } The panel’s element, or null before it is built.
bool Hidden { get; set; } Whether the panel is hidden. A hidden panel keeps its element and stops refreshing.
protected VtUiRoot Root { get; } The root this panel sits under, or null.
protected VisualElement InstantiateLayout() Clone Layout, or the shipped DefaultLayout when none is set, and hand back its root element. Null when neither exists, so the panel draws nothing.
void Toggle() Show or hide the panel.
protected abstract VisualElement Build() Build the panel’s element. Called once per root.
protected abstract void Refresh() Update the element from the game. Runs every frame while the panel is shown.
void PlaceIn(VisualElement container) Put the panel under container, an element of your own, instead of a region of the root. Null goes back to the region. The element is built again under the new parent.
void RefreshNow() Draw the panel now, attaching it if needed, instead of waiting for the next frame, for example right after changing what it shows.
protected bool EnsureAttached() Build the element now if it is not on screen yet. True when it is.
protected void Detach() Take the element off screen and forget it.

VtWindowPanel

Abstract component base.

Base of every window controller: builds a VtWindow once on a layer of the VtUiRoot, opens and closes it through the VtUiNavigation when the scene has one, so Esc and the gamepad close it and gameplay input is held while it is open, and refreshes it every frame while it is open. Subclasses fill the window in BuildContent and update it in Refresh.

Inspector fields

Field Type Description
Title (title) string The window’s title, or its localization key. Empty uses the panel’s own default.
Layer (layer) VtUiLayer Which layer of the root the window sits on.
Draggable (draggable) bool Let the player drag the window by its header.
Starts Open (startsOpen) bool Open the window as soon as the scene starts.

Scripting API

Member Description
VtWindow Window { get; } The window, or null before it is built.
bool IsOpen { get; } Whether the window is open.
protected abstract string DefaultTitle { get; } The title shown when the field is empty.
protected VtUiRoot Root { get; } The root this window sits under, or null.
protected VtUiNavigation Navigation { get; } The navigation stack windows open through, or null when the scene has none.
protected abstract void BuildContent(VtWindow window) Fill window with the panel’s content. Called once per build.
protected abstract void Refresh() Update the content from the game. Runs on open and every frame while open.
void Open() Open the window on top of the navigation stack, or on its own without one.
void Close() Close the window.
void Toggle() Open the window when it is closed, close it when it is open.
void PlaceIn(VisualElement container) Put the window under container, an element of your own, instead of a layer of the root. Null goes back to the layer. The window is built again under the new parent.
void RefreshNow() Draw the window now while it is open, instead of waiting for the next frame, for example right after changing what it shows.
protected bool EnsureBuilt() Build the window now if it is not on screen yet. True when it is.
protected void Detach() Take the window off screen and forget it.

VtUnitFramePresenter

Class.

Reads a unit into a VtUnitFrameState: name, level, death, every pool, the active buffs folded by definition, and the cast or channel in progress. Bind it to a unit once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Unit { get; } The unit being read, or null.
void Bind(VtUnit target) Read target from now on. Null reads nothing.
void Read(VtUnitFrameState state) Fill state from the bound unit. Clears it when there is none.
static VtCastState ReadCast(VtUnitAbilities abilities) The cast or channel abilities has in progress, inactive when there is none or abilities is null.

VtResourceBarPresenter

Class.

Reads one amount of a unit into a VtResourceBarState: a pool with its name and numbers, the experience with the level and the numbers or “Max level”, or the cast in progress with the ability and the seconds left. Bind it to a unit once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Unit { get; } The unit being read, or null.
void Bind(VtUnit target) Read target from now on. Null reads nothing.
void Read(VtResourceBarState state, VtBarSource source, VtResourceKind pool) Fill state with source of the bound unit, pool naming the pool for VtBarSource.Pool. Clears it when there is nothing to show.
static VtProgressKind KindOf(VtResourceKind kind) The bar colour for a pool kind: health, mana, stamina for the stamina-like pools, else the accent.

VtXpPresenter

Static class.

Reads a unit’s level and experience into a VtXpState. A unit without a VtUnitLevel reads as its definition’s level with no experience.

Scripting API

Member Description
static VtXpState Read(VtUnit unit) The state of unit.
static VtXpState Read(VtUnit unit, VtUnitLevel level) The state of unit with its level component already looked up.

VtActionBarPresenter

Class.

Reads a unit’s VtAbilityHotkeys into a list of VtActionSlotState: the ability, its key, the cooldown with the global cooldown folded in, whether it is affordable and whether it is being aimed. Bind once, read every frame; the list is reused.

Scripting API

Member Description
VtAbilityHotkeys Hotkeys { get; } The hotkeys being read, or null.
int SlotCount { get; } How many slots the bound hotkeys have.
void Bind(VtAbilityHotkeys target) Read target from now on. Null reads nothing.
void Read(List<VtActionSlotState> slots) Fill slots with one entry per hotkey slot. Empties it when nothing is bound.
static string Describe(VtAbilityDefinition ability) The cost line for ability: “20 MP · 1.5s”, “instant”, “channel”, or empty.
static string Caption(VtAbilityDefinition ability) The short line under a slot for ability: its cost, “20 MP”, or for a free ability its cast, “1.5s”, “instant” or “channel”. Empty for null.

VtStatListPresenter

Static class.

Reads the rows of a stat list off a unit’s modifiers and formats their values. No UI types, so any view can draw them.

Scripting API

Member Description
static float Read(VtUnitModifiers modifiers, in VtStatRow row) The value of row on modifiers: the attribute total, the stat’s percentage bonus for VtStatFormat.BonusPercent, otherwise the stat’s flat total.
static void Read(VtUnitModifiers modifiers, VtStatRow[] rows, float[] values) Fill values with the value of each row. The array must be at least as long as rows.
static string Format(VtStatFormat format, float value) value printed as format says: “120”, “25%” or “+30%”.

VtInventoryPresenter

Class.

Reads a unit’s bag into a VtInventoryState: every entry with its count and durability, whether the unit can put it on and why not, whether it can be used, and the wallet in sort order. Bind it to a unit once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Unit { get; } The unit being read, or null.
VtUnitInventory Inventory { get; } The bag being read, or null when the unit has none.
VtUnitEquipment Equipment { get; } The unit’s equipment, which decides what can be put on.
VtUnitWallet Wallet { get; } The wallet being read, or null when the unit has none.
void Bind(VtUnit target) Read target from now on. Null reads nothing.
void Read(VtInventoryState state) Fill state from the bound unit. Clears it when there is none.
static void ReadCurrencies(VtUnitWallet source, List<VtCurrencyState> into) Fill into with every currency in source, lowest sort weight first. A null wallet empties the list.

VtEquipmentPresenter

Class.

Reads a unit’s worn gear into a VtEquipmentState: every slot with the item in it and its durability, and every set the unit wears a piece of with the pieces worn and the tier that is active. Bind it to a unit once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
static IReadOnlyList<VtEquipmentSlot> Slots { get; } Every equipment slot except VtEquipmentSlot.None, in the order the enum declares them. The order a page draws its slot rows in.
VtUnit Unit { get; } The unit being read, or null.
VtUnitEquipment Equipment { get; } The equipment being read, or null.
void Bind(VtUnit target) Read target from now on. Null reads nothing.
void Read(VtEquipmentState state) Fill state from the bound unit. Clears it when there is none.

VtQuestLogPresenter

Class.

Reads a unit’s VtUnitQuestLog into a VtQuestLogState: the quests grouped by where they stand, their time limits and repeat cooldowns, and each objective’s line and progress. Bind it to a unit once and read whenever the panel refreshes. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Unit { get; } The unit being read, or null.
VtUnitQuestLog Log { get; } The log being read, or null when the unit has none.
void Bind(VtUnit target) Read target from now on. Null reads nothing.
void Read(VtQuestLogState state) Fill state from the bound unit. Clears it when there is none.

VtDialoguePresenter

Class.

Reads a unit’s VtUnitDialogue into a VtDialogueState: the speaker, the line, the answers with their kind and whether they are locked, and whether the line continues or ends the conversation. Bind it to a unit once and read whenever the window refreshes. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Unit { get; } The unit being read, or null.
VtUnitDialogue Dialogue { get; } The dialogue being read, or null when the unit has none.
void Bind(VtUnit target) Read target from now on. Null reads nothing.
void Read(VtDialogueState state) Fill state from the bound unit. Clears it while nothing is being said.

VtCraftingPresenter

Class.

Reads a unit into a VtCraftingState: its crafting skills with level and experience, the recipes it knows plus the ones the window is configured with, every recipe’s ingredients against what it carries, why a recipe cannot be crafted, the craft in progress and the station it stands at. Bind it to a unit once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Unit { get; } The unit being read, or null.
VtUnitCrafter Crafter { get; } The unit’s crafter, or null when it has none.
List<VtRecipeDefinition> Recipes { get; } The recipes the window always lists, known or not. Fill it from the window.
List<VtCraftingStation> Stations { get; } The stations the presenter measures against. RefreshStations fills it from the loaded scene; fill it yourself to limit the search.
void Bind(VtUnit target) Read target from now on, and look for its stations. Null reads nothing.
void RefreshStations() Look for the crafting stations in the loaded scene again, after one was spawned or destroyed.
bool IsInReach(VtCraftingStation station) Whether the unit stands close enough to station to use it.
VtCraftingStation NearestStation(VtRecipeStationDefinition type) The station of type nearest the unit, or null. A null type has no station.
VtCraftingStation StationInReach() The nearest station the unit stands at, whatever its type, or null.
void Read(VtCraftingState state) Fill state from the bound unit. Clears it when there is none.

VtTalentPresenter

Class.

Reads a unit into a VtTalentState: its level, the talent and attribute points it has left, every attribute the tree allows with its total and whether a point may go in, and every talent with its rank, what it needs and why it cannot be learned. Bind it to a unit once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Unit { get; } The unit being read, or null.
VtUnitProgression Progression { get; } The unit’s progression, or null when it has none.
void Bind(VtUnit target) Read target from now on. Null reads nothing.
void Read(VtTalentState state) Fill state from the bound unit. Clears it when there is none.
string Requirements(VtTalentDefinition talent) What talent needs as one line: “Level 3 · Heavy Blows 2”. Empty when it needs nothing. The line is built once per talent and kept.

VtBuildPresenter

Class.

The reading side of a build menu: reads a unit into a VtBuildState with the category tabs, the pieces in the chosen category, whether each can be built and why not, every cost line against the unit’s cost source, and the piece being placed. Select starts placing a piece. Bind it to a unit once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Unit { get; } The unit being read, or null.
VtUnitBuilder Builder { get; } The unit’s builder, or null when it has none.
List<VtBuildableDefinition> Buildables { get; } The pieces the menu lists. Leave it empty to list every buildable in the catalog.
VtDefinitionCatalog Catalog { get; set; } The catalog read while Buildables is empty. Null uses the shared catalog.
bool FilterByCategory { get; set; } Whether the menu shows one category. False lists every piece.
VtBuildableCategoryDefinition Category { get; set; } The category shown while FilterByCategory is on; null shows the pieces without one.
void Bind(VtUnit target) Read target from now on. Null reads nothing.
void ShowCategory(VtBuildableCategoryDefinition category) Show only category; null shows the pieces without one.
void ShowAll() Show every piece.
bool Select(VtBuildableDefinition buildable, out VtBuildFailureReason reason) Start placing buildable. Selecting the piece being placed stops placing it; selecting another switches to it. False with the reason when placement did not start.
void Read(VtBuildState state) Fill state from the bound unit. Clears it when there is none.

VtSelectionPresenter

Class.

Reads a VtUnitSelection and its VtControlGroups into a VtSelectionState: the selected units with their health and which one is the primary, and the control groups with their sizes and whether the selection is in them. Bind it once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnitSelection Selection { get; } The selection being read, or null.
VtControlGroups Groups { get; } The control groups being read, or null.
void Bind(VtUnitSelection unitSelection, VtControlGroups controlGroups) Read unitSelection and controlGroups from now on. Both may be null; without groups the state’s group list stays empty.
void Read(VtSelectionState state) Fill state from the bound selection. Clears it when there is none.
static float HealthOf(VtUnit unit) The health of unit from 0 to 1, or 0 when it has no health pool.

VtThreatPresenter

Class.

Reads the threat table a player wants to see into a VtThreatState: the table of the unit the viewer has selected, or else of the unit it is fighting, with every attacker sorted from highest threat to lowest and each row’s share of the top. Bind it to the viewer once and read every frame. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Viewer { get; } The unit the list is seen from, or null.
void Bind(VtUnit player) Read the table player is looking at from now on. Null reads nothing.
VtUnit CurrentTarget() The unit whose table the viewer is looking at right now: its selected unit when that unit keeps a threat table, else the unit it is fighting when that one does, else null.
void Read(VtThreatState state) Fill state from the table the viewer is looking at. Clears it when there is none.

VtInteractionPresenter

Class.

Finds the nearest thing a player can right-click — a quest giver, a vendor, a crafting station, a dropped item or a resource node — and describes it for the interaction prompt. Looking for them is a scene scan, so it happens on demand through Rescan; Read only measures the units found last time, which is cheap enough for every frame.

Scripting API

Member Description
VtUnit Player { get; } The player the prompt is for, or null.
float Range { get; set; } Metres the prompt reaches, unless the thing itself reaches further.
IReadOnlyList<Component> Found { get; } The things found by the last Rescan, in the order they were found.
Func<IEnumerable<Component>> Candidates { get; set; } The things the prompt considers. Null looks through the scene for the interactables Vantage ships: quest givers, vendors, crafting stations, dropped items and resource nodes.
Func<Component, string> VerbProvider { get; set; } The verb for a thing, a localization key. Null uses DefaultVerb.
Func<Component, string> NameProvider { get; set; } The name of a thing. Null uses DefaultName.
void Bind(VtUnit unit) Show prompts for unit from now on. Null shows nothing. Looks for interactables straight away.
void Rescan() Look for interactables again, after spawning or removing one. The prompt does this on a timer of its own; call it to pick up a change in the same frame.
void Read(VtInteractionState state) Fill state with the nearest thing in range. Clears it when there is none.
static string DefaultVerb(Component target) The verb for target: talk to a quest giver, trade with a vendor, use a crafting station, gather a resource node and pick up anything else.
static string DefaultName(Component target) The name of target: the item on a dropped item, the resource on a node, the unit’s name on an NPC, and the object’s name for anything else.

VtMinimapPresenter

Class.

Reads what a minimap shows around a unit into a VtMinimapState: the map area it stands in, itself, the units around it by their relation to it, quest givers with something for it, the places and people its active quests send it to, and the VtMapMarkers in the scene. Units and markers in the fog of war show by their own rule. No UI types, so any view can draw it.

Scripting API

Member Description
VtUnit Viewer { get; } The unit being read, or null.
VtMinimapFilter Filter Which markers are read.
Func<Vector3, bool> IsVisible Whether a point is in sight. Null asks the scene’s VtFogOfWar, and everything is in sight without one.
Func<Vector3, bool> IsExplored Whether a point has been seen. Null asks the scene’s VtFogOfWar, and everything has been seen without one.
void Bind(VtUnit unit) Read around unit from now on. Null reads nothing.
void Read(VtMinimapState state) Fill state around the bound unit. Clears it when there is none.

VtTooltipContent

Class.

What a tooltip shows, with no UI types: a title, a subtitle, label and value rows and free lines. VtItemTooltip and VtAbilityTooltip build one from a definition; a tooltip element draws it. Reuse an instance with Clear to avoid allocations.

Scripting API

Member Description
bool IsEmpty { get; } Whether there is anything to show.
string Title The title, a localization key or the text itself.
string Subtitle The muted line under the title, such as a rarity or a targeting mode.
readonly List<VtTooltipRow> Rows Label and value rows, shown before the lines.
readonly List<VtTooltipLine> Lines Free lines, shown after the rows.
VtTooltipContent Clear() Forget everything.
VtTooltipContent Row(string label, string value, VtTooltipLineKind kind = VtTooltipLineKind.Normal) Add a label and value row.
VtTooltipContent Line(string text, VtTooltipLineKind kind = VtTooltipLineKind.Normal) Add a line.

VtAbilityTooltip

Static class.

Builds the tooltip of an ability: its name, how it targets, the cost, cast time, cooldown, range and area, what its effects do, such as “Damage 40 – 55 Fire” or “Applies Burning”, and its description. No UI types; a tooltip element draws the result.

Scripting API

Member Description
static void RegisterEffect<T>(Action<T, VtTooltipContent> describe) Describe effects of type T with describe, which adds rows or lines to the tooltip being built. Registering a type again replaces the first describer.
static VtTooltipContent Build(VtAbilityDefinition ability, VtTooltipContent content) Fill content for ability. A null ability clears it.
static string CastText(VtAbilityDefinition ability) The cast column: “Instant”, “1.5 s” or “Channel 4 s”.
static string TargetingKey(VtTargetingMode mode) The localization key naming mode.
static string DamageText(int min, int max, VtDamageType type) A damage roll as “40 – 55 Fire”, or “40 Fire” when the two ends meet.

VtItemTooltip

Static class.

Builds the tooltip of an item: its name, rarity and slot, every stat and attribute bonus, the set it belongs to with the pieces worn, its requirements marked when the viewer does not meet them, what using it does, its value and its description. No UI types; a tooltip element draws the result.

Scripting API

Member Description
static VtTooltipContent Build(VtItemDefinition item, VtUnit viewer, VtTooltipContent content) Fill content for item as seen by viewer, which may be null. With a viewer, unmet requirements read as bad and the set line counts the pieces worn.
static string Subtitle(VtItemDefinition item) The rarity and the slot, joined with a dot, or whichever the item has.
static string SlotName(VtEquipmentSlot slot) An equipment slot as words: “Main hand”, “Ring 1”.

VtBuffTooltip

Static class.

Builds the tooltip of a buff on a unit: its name, the stacks, the time left, every stat and attribute it changes, what it does each tick, and its description. No UI types; a tooltip element draws the result.

Scripting API

Member Description
static VtTooltipContent Build(in VtBuffState buff, VtTooltipContent content) Fill content for buff as a unit carries it. A buff without a definition clears it.

VtTooltips

Static class.

The one tooltip a screen shows, and the wiring that puts it up. Give Host the VtTooltip sitting on the tooltip layer, then hand any element a source of content with Attach: the tooltip follows the pointer and the focus, so a player on a gamepad reads the same text as a player on a mouse.

Scripting API

Member Description
static VtTooltip Host { get; set; } The tooltip every call goes to, normally the one on the tooltip layer. Null means no tooltips.
static int DelayMs How long the pointer or the focus rests on an element before its tooltip goes up, in milliseconds.
static void Attach(VisualElement element, Func<VtTooltipContent> source, VtTooltipPlacement placement = VtTooltipPlacement.Element) Show the tooltip for element after the delay whenever the pointer or the focus reaches it, and take it down when they leave. source is asked each time, so it can read live numbers; handing back null or an empty content shows nothing. placement puts the tooltip under the element, or under the pointer and following it. Attaching twice replaces the first source.
static void Detach(VisualElement element) Stop showing a tooltip for element.
static bool IsAttached(VisualElement element) Whether element has a tooltip source on it.
static void ShowNow(VisualElement anchor, VtTooltipContent content) Put content up next to anchor right away, without the delay, for a key press or a selection that should explain itself at once. Nothing to show takes the tooltip down.
static void ShowAtPointer(Vector2 panelPosition, VtTooltipContent content) Put content up under the pointer at panelPosition, in panel coordinates as pointer events report them, right away. It flips above near the bottom of the screen and slides left at the right edge. Nothing to show takes the tooltip down.
static void Hide() Take the tooltip down.

VtTheme

Static class.

Switches the Vantage theme at runtime. Each option is a class on the element you pass, normally UIDocument.rootVisualElement, and the Vantage theme style sheet redefines the --vt- colour, radius and font variables for that class, so everything under the element follows.

Scripting API

Member Description
const string TypefacePrefix Start of every typeface class name.
const string InterTypeface The Inter typeface, the default.
static string ClassName(VtThemeMode mode) The class for mode.
static string ClassName(VtThemeAccent accent) The class for accent.
static string ClassName(VtThemeRadius radius) The class for radius.
static void SetMode(VisualElement root, VtThemeMode mode) Use mode for everything under root.
static void SetAccent(VisualElement root, VtThemeAccent accent) Use accent for everything under root.
static void SetRadius(VisualElement root, VtThemeRadius radius) Use radius for everything under root.
static void SetTypeface(VisualElement root, string typefaceClass) Use the typeface class typefaceClass, replacing any other typeface class. Null or empty goes back to Inter.
static VtThemeMode GetMode(VisualElement root) The mode set on root, Dark when none is.
static VtThemeAccent GetAccent(VisualElement root) The accent set on root, Neutral when none is.
static VtThemeRadius GetRadius(VisualElement root) The radius set on root, Medium when none is.
static string GetTypeface(VisualElement root) The typeface class set on root, InterTypeface when none is.

VtUiStates

Static class.

The state classes every Vantage component and every panel of your own shares, so one rule in the theme styles selected and disabled-looking elements wherever they appear: chips, rows, buttons and list entries.

Scripting API

Member Description
const string SelectedUssClassName Class on a chosen chip, row, button or entry.
const string DisabledUssClassName Class on an element that should look unavailable.
static void SetSelected(VisualElement element, bool selected) Add or remove SelectedUssClassName on element.
static void SetDisabledLook(VisualElement element, bool disabled) Add or remove DisabledUssClassName on element.

VtIcons

Static class.

Where VtIcon and every Vantage component look an icon id up. The shipped Resources/VtIconSet holds the Lucide glyphs the package uses. Install puts your own VtIconSet in front of it: ids it has win, ids it lacks fall through to the shipped set, so you can replace one glyph or add a hundred without copying the rest.

Scripting API

Member Description
static VtIconSet Installed { get; } The set installed with Install, or null when the shipped set is the only one.
static VtIconSet Shipped { get; } The shipped set, loaded from Resources on first use. Null when it is missing.
static event Action OnChanged Fires after Install. Icons on screen redraw here.
const string ResourcePath Resources path of the shipped icon set.
static void Install(VtIconSet set) Look ids up in set before the shipped set. Null goes back to the shipped set alone.
static bool TryGet(string id, out Background background) The image for id: from the installed set and its fallbacks, else the shipped set.
static bool Contains(string id) Whether any set has an icon called id.
static void ResetCache() Forget the loaded and the installed set, going back to the shipped set alone.

VtUiLayouts

Static class.

Default layouts for panels built on VtHudPanel, one UXML file each under any Resources/VtLayouts folder. A panel clones its layout and finds its parts by name, so a layout of your own with the same names, set on the panel’s Layout field, changes how the panel is arranged without any code.

Scripting API

Member Description
static VisualTreeAsset Load(string name) The layout called name under Resources/VtLayouts, or null with one warning when it is missing.
static VisualElement Instantiate(VisualTreeAsset layout) Clone layout and hand back its root element: the single top-level element of the file, or the whole clone when the file has several. Null for a null layout.
static void ResetCache() Forget the loaded layouts, so the next Load reads each file again.

VtIconEntry

Serializable class.

One icon in a VtIconSet: an id and the image drawn for it.

Inspector fields

Field Type Default Description
Id (id) string Empty The name UI refers to the icon by, such as ‘chevron-down’.
Vector (vector) VectorImage None A vector image, tinted by the UI. Used when set.
Sprite (sprite) Sprite None A sprite, used when there is no vector image.

Enums

VtUiLayer

The layers of a screen, from the back to the front.

Value Description
World Things anchored to the world: nameplates, interaction prompts, markers.
Hud The HUD: frames, bars, action bar, quest tracker.
Windows Windows opened while playing: inventory, quest log, crafting.
Menus Menus that take over: the game menu, settings.
Overlays Overlays on top of everything: dialogs, toasts, the death screen.
Tooltip The tooltip, always in front.

VtUiRegion

A place on the HUD layer for panels that just need a corner or an edge.

Value Description
TopLeft Top left corner, stacking down.
TopCenter Top edge, centred.
TopRight Top right corner, stacking down.
BottomLeft Bottom left corner, stacking up.
BottomCenter Bottom edge, centred.
BottomRight Bottom right corner, stacking up.

VtMapMarkerTint

Which colour a VtMapMarker takes on the minimap.

Value Description
Foreground The text colour.
Muted The secondary text colour.
Primary The accent.
Quest The quest colour.
Hostile The hostile colour.
Friendly The friendly colour.
Neutral The neutral colour.

VtMapMarkerReveal

When a VtMapMarker shows through the fog of war.

Value Description
Always Always, fog or not.
WhenExplored Once the player has seen the spot.
WhenVisible Only while the spot is in sight.

VtBarSource

What a resource bar reads from its unit.

Value Description
Pool One of the unit’s resource pools: health, mana, stamina and the rest.
Experience The unit’s experience towards its next level.
Cast The cast or channel in progress. The bar is empty while nothing is cast.

VtResourceKind

The kind of a resource pool on a unit, such as health, mana, stamina or rage. A unit definition lists the pools it has; read one with VtUnitStats.GetPool.

Value Description
HP Health. The unit dies when it reaches 0.
MP Mana, spent by spells.
Stamina Stamina, spent by physical actions such as sprinting or dodging.
Rage Rage, built by dealing and taking damage rather than regenerating.
Focus Focus, a small fast-refilling pool for ranged or precise actions.
Energy Energy, a fixed-size pool that refills quickly.
ComboPoints Combo points, built by some abilities and spent by finishers.
Charges Charges, discrete uses that refill one at a time.
Hunger Food pool: decreases over time, damages HP when empty.
Thirst Water pool: decreases over time, damages HP when empty.
Shield Secondary HP layer — sci-fi / mage-barrier style. Regenerates out of combat (per the configured VtRegenMode); takes damage before HP only when consumer code wires that interception (typically via an VtUnitStats.OnPreTakeDamage hook). Pair with stat.max_shield / stat.shield_regen.

VtProgressKind

The colour of a VtProgressBar’s fill.

Value Description
Primary The accent colour. The default.
Health The health colour.
Mana The mana colour.
Stamina The stamina colour.
Experience The experience colour.
Cast The cast colour, for a cast or channel in progress.

VtStatFormat

How a stat list prints a value.

Value Description
Flat The flat total, such as armor 120.
FlatAsPercent The flat total read as a fraction, such as crit chance 0.25 shown as 25%.
BonusPercent The percentage bonus, such as physical power +30%.

VtEquipmentSlot

The set of equipment slots an item can occupy on a unit. Used as the key for the slot map on VtUnitEquipment and as the source-id suffix when equipped items push their modifiers / attributes / traits ("equipment_<slot>").

Value Description
None Inventory-only / non-equippable. Potions, materials, quest items.
Head Helm / hat / hood.
Chest Chestpiece / robe / breastplate.
Legs Leg armor / pants / greaves.
Feet Boots / sandals / sabatons.
Hands Gloves / gauntlets / bracers.
MainHand Primary weapon. 2H weapons occupy this slot and block OffHand.
OffHand Off-hand weapon, shield, or focus. Auto-unequipped when a 2H is equipped to MainHand.
Neck Necklace / amulet / pendant.
Ring1 First ring slot. Members of the Ring family.
Ring2 Second ring slot. Members of the Ring family.
Trinket1 First trinket slot. Members of the Trinket family.
Trinket2 Second trinket slot. Members of the Trinket family.
Back Worn on the back: backpack, cloak, quiver.

VtBuildFailureReason

Why a builder call was refused or a placement is invalid.

Value Description
None Nothing refused: the call succeeded or the placement is valid.
BuildableNull No buildable was given, or it has no prefab.
MissingItems The builder cannot pay the buildable’s item cost.
MissingCurrency The builder cannot pay the buildable’s currency cost.
MissingRequiredItems The builder does not carry the buildable’s required items, such as a hammer.
LevelTooLow The builder’s level is below the buildable’s required level.
MissingPrereqQuests A quest the buildable requires has not been turned in.
BlockedByCollider A collider on the buildable’s forbidden overlap layers is in the way.
NoSurface The cursor points at no surface the piece can stand on.
AlreadyPlacing A placement is already in progress.
NotPlacing Nothing is being placed.
AuthorityNotLocal This copy is not the authority. VtUnitBuilder.TryPlace and VtUnitBuilder.TryDemolish send the request to the authority, which decides.
NoBuilderComponent The unit has no builder component.
NotABuildable The target of a demolish is not something this system placed.
CrossesCliff The footprint spans more than one cliff level or lies on a ramp.
OutOfRange The placement point is farther from the builder than the buildable’s placement range.
Locked The buildable’s VtBuildableDefinition.requiredUnlock is not owned.
BlockedGround The footprint covers a cell the cliff map marks as blocked.
RefusedByRule A placement rule refused. VtBuildRefusal.RuleKey carries the rule’s own reason.

VtTooltipLineKind

How a tooltip line reads.

Value Description
Normal Plain text.
Muted Secondary text, such as flavour or a hint.
Good Something in the player’s favour, such as a bonus.
Bad Something against the player, such as an unmet requirement.

VtTargetingMode

How an VtAbilityDefinition picks its target.

Value Description
Self No target — the ability affects the caster directly.
SingleTarget A single IVtAttackable. Most melee / single-shot ranged abilities.
GroundPoint A world-space point. Ground-targeted AoE (meteor strike, blizzard, healing circle).

VtDamageType

The element of an attack — routed through the corresponding resistX stat on VtCoreStats in VtUnitStats.TakeDamage.

Value Description
Physical Weapons, claws and falling rocks. Reduced by armor; resisted by stat.resist_physical.
Fire Fire and burning. Resisted by stat.resist_fire.
Cold Frost and ice. Resisted by stat.resist_cold.
Poison Poison and venom, often dealt over time. Resisted by stat.resist_poison.
True Bypasses all mitigation (resistance, armor, matrix). Use sparingly.
Lightning Electricity / chain-lightning / EMP-flavor. Resisted by stat.resist_lightning.
Holy Paladin / priest school. Strong vs undead in many genres. Resisted by stat.resist_holy.
Shadow Warlock / necromancer school — corruption, agony, void. Resisted by stat.resist_shadow. Often paired oppositionally with Holy.
Arcane Mage’s “raw magic” school — distinct from elemental. Magic missile, polymorph. Resisted by stat.resist_arcane. Conventionally hardest to resist.
Nature Druid / shaman school — earth, plant, weather, wildlife. Resisted by stat.resist_nature.

VtTooltipPlacement

Where a tooltip goes relative to the element it explains.

Value Description
Element Under the element, lined up with its left edge. The default.
Pointer Under the pointer, following it while it moves over the element. Focus from a gamepad or the keyboard has no pointer, so it falls back to the element.

VtThemeMode

Light or dark colours.

Value Description
Dark Dark surfaces with light text. The default.
Light Light surfaces with dark text.

VtThemeAccent

The colour of the accent, used for primary buttons, selected states and progress.

Value Description
Neutral The text colour. The default.
Blue Blue.
Violet Violet.
Rose Rose.
Orange Orange.
Green Green.

VtThemeRadius

Corner radius of cards and controls.

Value Description
None Square corners.
Small 4 pixels.
Medium 8 pixels. The default.
Large 12 pixels.
ExtraLarge 16 pixels.