ui global
The retained Menu and HUD and their primitives, generated from the shipped declarations.
Generated from the declarations in @disko-game/build/types. See
Menus & HUD for a guide.
The ui global
The retained Menu and HUD.
UI
Disko.UiStyle
A frozen style created by ui.style.
Disko.UiStyleDeclarations
Style declarations: sizes in pixels or CSS-like strings, colors as tokens or hex.
Disko.UiTheme
A frozen theme created by ui.theme.
Disko.UiRequest
A request to the game when a control is used, created by ui.request.
Disko.UiLocalCommand
A local client-side command such as ui.open(modal).
Disko.UiSwap
A content replacement pushed with ui.push.
Disko.UiNode
A retained UI node.
Disko.UiContent
Content accepted wherever children are.
Disko.UiTrigger
A semantic trigger, independent of the input device.
Disko.UiTargetReference
A node, or a target relative to the source: itself, its nearest form or slot.
Disko.UiValue
A value carried by UI controls and local commands.
Disko.UiRequirement
Gates a node on a permission. Recipients without it do not receive the node and its subtree (denied: "hide", the default), or receive them disabled and without server requests (denied: "disable").
Disko.UiOptions
Options shared by every UI primitive.
| Member | Description |
|---|---|
requires | Hides or disables this node for players without the permission. |
name | Form field name. |
alt | Alternative text of an image. |
[index] | Direct style properties are accepted beside style. |
Disko.UiPlayerOptions
Options of a primitive that shows one player.
Disko.UiValueSchema
The closed schema of the values a request carries.
Disko.UiSwapMethod
How the response content is placed at the target.
Disko.UiConcurrencyPolicy
Disko.UiRequestOptions
Options of ui.request.
| Member | Description |
|---|---|
event | The ui-request event name the game receives. |
target | Where the response goes; defaults to the source ("this"). |
swap | Defaults to "replace". |
values | Values collected by the client; defaults to "none". |
concurrency | Defaults to "queue" with a limit of one. |
payloadSchema | Defaults to { type: "null" }. |
requires | Only players with this permission can use the request; for the others the control is disabled and carries no request. |
Disko.UiPrimitive
A UI primitive constructor.
Disko.Ui
The retained UI API: Menu, HUD and their primitives.
| Member | Description |
|---|---|
menu() | Sets the Menu, shown while the room is not playing or on Esc. |
hud() | Sets the HUD of the running match. |
push() | Publishes swaps to everyone, or only to one player. |
flag() | A player's country flag; player is required. |
connection() | A player's connection quality; player is required. |
playerName() | A player's name in the room's color with its badge, rendered by the client; the node holds only the player's identity. player is required. |