Attribute reference¶
Every attribute and head tag a document can use, grouped by where it goes. Each row names the value, what it does and the
page that explains it. Names in angle brackets are filled in:
class:<name> is class:active.
Head <meta>¶
<meta name="..." content="..."/>, each name at most once. Details and defaults: Documents.
| Name | Value | Effect |
|---|---|---|
layer |
a UI.Layer.* tag from the Layer Order setting |
The layer the document opens on; layers stack in the order of the Layer Order setting. |
input-mode |
game, menu, all |
Who gets input while the document is open: game the game only, menu the document, all both (input mode). |
hide-lower |
true, false |
Hides documents on lower layers while open. |
keep-alive |
true, false |
Closing parks the document instead of destroying it, and keeps its state (Keep-alive and preload). |
input-mapping |
package path of an Input Mapping Context | Binds its actions as UI actions while the document is active. |
input-mapping-priority |
integer | Priority of that context; needs input-mapping. |
mouse-capture |
true, false |
With input-mode all, hides the cursor and captures the mouse for the game (cursor). |
any-input |
true, false |
Sends anyinput on every key and pad press (Events). |
frame |
package path of a document | Makes this document a tab of that frame (Frames and tabs). |
Head <viewmodel>¶
Declares one view model. Details: View models.
| Attribute | Value | Effect |
|---|---|---|
name |
text, unique in the document | The name :model uses. |
class |
script path of a UMVVMViewModelBase class |
The model's class. |
create, context, resolver, manual, path |
see View models | The source of the instance, exactly one: create, the document makes it; context, it is looked up in the GameInstance's view model collection; resolver, a resolver class makes it; manual, game code assigns it; path, it is read through a chain of properties or getter functions that starts at the player controller, its pawn or the local player. |
settable |
true |
Game code may replace the instance. |
optional |
true |
Focus entering the document's focus areas does not wait for an unresolved model, which it does without this attribute. |
on-close |
function name | A function without arguments, called on the model when the view closes or is parked. |
preview |
path of a JSON file | A stand-in model for the editor preview; takes no class or source. |
Binding¶
An expression reads a field as <model>.<Field>. Details: Data binding.
| Attribute | Value | Effect |
|---|---|---|
:model |
a <viewmodel> name |
The model the element and its children read. |
:if |
expression | Present only while true. |
:visible |
expression | Sets visibility; the layout stays. |
:for |
row, index : List |
One element per row (Lists). |
:key |
a member of the row | The row identity of a :for element. |
:virtual |
none | On a :for element, creates only the rows near the scrolled area; the parent must scroll vertically (Virtual lists). |
:rml |
expression | Replaces the element's content with the RML in the value; never use it for text a player typed (Inner RML). |
class:<name> |
expression | Adds the class while true. |
style:<property> |
expression | Sets one style property. |
attr:<name> |
expression | Sets an attribute to the value. |
attrif:<name> |
expression | Sets an empty attribute while true, removes it otherwise (Navigation). |
pulse:<class> |
expression | Removes and adds the class again on each change of the value, so an animation restarts; the first value never pulses (Styling). |
:value |
expression | Sets the value attribute; writes a writable model field back on change (Forms). |
:checked |
expression | A boolean sets checked; other values check the element when they equal its value (Forms). |
:world |
expression giving "x y z" |
Places the element over a world point (World markers). |
alias:<name> |
a data path | Makes <name> stand for that path in the element and its descendants (Aliases). |
on:<event> |
expression list | Runs the calls on an event (Events, event reference). |
data-action |
close or open:<package path> |
Closes the document or opens another (Events). |
Input and focus¶
Details: Navigation, Input and gamepad.
| Attribute | Value | Effect |
|---|---|---|
data-focus-area |
area name | Makes the element a navigation area, a focus area. |
data-focus-primary |
empty | Marks the primary area, the focus area that gets focus first when the document opens. |
data-focus-parent |
area name | Where Back returns before it leaves the area. |
data-focus-exit |
selector | The element clicked when Back leaves the area. |
data-focus-enter |
area name | On an item: its click sends focus into that area. |
data-focus-down |
area name, or empty for the primary area | Down enters that area. |
data-focus-contain |
empty | Keeps navigation inside the area and the areas in it, for a popup. |
data-focus-owner |
empty | Marks the container of a popup and its trigger for ev.related_in_owner on blur (Events). |
data-focus-active |
set by the plugin on <body>; do not write it |
The name of the area that holds focus, for CSS selectors. |
:focus-request |
expression | Each later non-empty change focuses the element (Focus requests). |
data-nav-left, -right, -up, -down |
selector | In the area, the arrow clicks the first visible match instead of moving focus. |
data-hotkey |
Input Action package path (or asset name) | Clicks the element when the action fires (Input and gamepad). |
data-hotkey-focus |
Input Action package path (or asset name) | The same, only for the focused element and its ancestors (A hotkey on the focused row). |
data-hotkey-cycle |
two Input Action package paths (or asset names), previous and next | On a container: steps through its focusable items. |
autofocus |
none | The element a document or area focuses first. |
data-mouse-release |
empty | In a mouse-capture document: while the element is shown, the cursor is shown and the mouse is not captured (cursor). |
Drag and drop¶
Details: Drag and drop.
| Attribute | Value | Effect |
|---|---|---|
data-drag-type |
words separated by spaces | Required on a drag source. |
data-drop-accept |
words separated by spaces | A target accepts a source that shares a word with its data-drag-type. |
data-drag-action |
Input Action package path (or asset name) | The action that picks up the focused source with pad or keyboard. |
Components, localization, frames¶
| Name | Where | Effect |
|---|---|---|
<dc-import> |
body | Places a component (Components). |
<dc-import name="<path>"> of a view |
body | Places a view: its body, with its models merged into the document's (Place a view). |
<link rel="component" href="<path>" as="<alias>"/> |
<head> |
Names a component, so <dc-import name="<alias>"> can use the alias (Components). |
<kbd action="<path>"/> |
body | Shows the current key of an Input Action, or of confirm, back, navigate, stepLeft, stepRight (Key labels). |
<viewmodel manual="true"> given at an import |
<dc-import> of a view |
member="{{ m }}": the attribute named like the view's manual model gives that copy its object (Place a view). |
<prop> |
component | Declares a property of the component. |
<state name type default/> |
component header | Declares a value the component keeps per placed copy, read as state.<name> (Local state). |
<slot>, slot |
component body, import child | Where the import's children go; slot="x" picks the named slot. |
loc |
an element with plain text | The text is the String Table entry of that key (Localization). |
loc-<prop> |
<dc-import> |
The same for a component property. |
arc-embed |
frame element | The box the shown tab is drawn in (Frames and tabs). |