@ignifx/ui 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/skills/ui/SKILL.md +26 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ignifx/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "ignifx UI: DOM overlay host, focus routing, world and HUD text.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ignifx",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"typedoc-plugin-markdown": "^4.13.0",
|
|
44
44
|
"typescript-native": "npm:typescript@7.0.2",
|
|
45
45
|
"vitest": "^5.0.0",
|
|
46
|
-
"@ignifx/core": "0.
|
|
47
|
-
"@ignifx/input": "0.
|
|
46
|
+
"@ignifx/core": "0.21.1",
|
|
47
|
+
"@ignifx/input": "0.21.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@babylonjs/lite": "1.34.0",
|
|
51
|
-
"@ignifx/core": "0.
|
|
52
|
-
"@ignifx/input": "0.
|
|
51
|
+
"@ignifx/core": "0.21.1",
|
|
52
|
+
"@ignifx/input": "0.21.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@ignifx/input": {
|
package/skills/ui/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: ui
|
|
|
3
3
|
description: Builds game UI in ignifx with @ignifx/ui: the DOM overlay host and layers, scaling modes, input focus routing, world-space anchors, world and HUD text on Babylon Lite's text renderer, menus and menu stacks, virtual joysticks and buttons for touch, dialogs, toasts, loading screens, and localization. Use when adding or editing menus, title/pause/settings screens, HUDs, on-screen text, touch controls, or overlay UI in an ignifx project, or when the user mentions @ignifx/ui, Menu, MenuStack, HudText, WorldAnchor, VirtualJoystick, or app.i18n.
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
|
-
ignifx-version: "0.
|
|
6
|
+
ignifx-version: "0.21.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# @ignifx/ui
|
|
@@ -24,7 +24,7 @@ documented no-op, and the components keep their state — so the same script run
|
|
|
24
24
|
|
|
25
25
|
## Environment
|
|
26
26
|
|
|
27
|
-
- Engine: ignifx `0.
|
|
27
|
+
- Engine: ignifx `0.21.1`; this package targets `@ignifx/core` `>=0.0.0 <1.0.0`.
|
|
28
28
|
- WebGPU only, browser and Electron. Babylon Lite `1.34.0` is a peer dependency.
|
|
29
29
|
- `@ignifx/input` is an **optional** peer: only `VirtualJoystick` and `VirtualButton` need it.
|
|
30
30
|
- Register it like any extension; nothing happens at import time.
|
|
@@ -45,12 +45,12 @@ if (canvas instanceof HTMLCanvasElement) {
|
|
|
45
45
|
|
|
46
46
|
`ignifx.config.ts` carries the same settings under `ui`:
|
|
47
47
|
|
|
48
|
-
| Setting
|
|
49
|
-
|
|
|
50
|
-
| `scaling`
|
|
51
|
-
| `referenceResolution` | `[1920, 1080]`
|
|
52
|
-
| `layers`
|
|
53
|
-
| `visible`
|
|
48
|
+
| Setting | Default | Meaning |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| `scaling` | `"css"` | `"css"`, `"fit"` or `"dpi"` — see below |
|
|
51
|
+
| `referenceResolution` | `[1920, 1080]` | The `[w, h]` `"fit"` scales to |
|
|
52
|
+
| `layers` | `["hud", "menu", "overlay"]` | Created up front, back to front |
|
|
53
|
+
| `visible` | `true` | Whether the overlay is shown |
|
|
54
54
|
|
|
55
55
|
`ui()` also takes `strings` (a `.i18n.json` address to load at start-up) and `locale`.
|
|
56
56
|
|
|
@@ -77,11 +77,11 @@ DOM.
|
|
|
77
77
|
`HudText`, and `captureScreenshot()` all work in **backing-store** pixels; a DOM element is placed in
|
|
78
78
|
**UI units**. The scaling mode decides what a UI unit is:
|
|
79
79
|
|
|
80
|
-
| Mode
|
|
81
|
-
|
|
|
82
|
-
| `"css"` | one CSS pixel
|
|
80
|
+
| Mode | One UI unit is | Use it for |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| `"css"` | one CSS pixel | responsive HTML menus (the browser default) |
|
|
83
83
|
| `"fit"` | one reference pixel | a HUD authored once at a fixed resolution, letterboxed |
|
|
84
|
-
| `"dpi"` | one backing pixel
|
|
84
|
+
| `"dpi"` | one backing pixel | a pixel HUD that must line up with a screenshot |
|
|
85
85
|
|
|
86
86
|
`app.ui.pixelMapping` converts between them, and `WorldAnchor` already does it for you.
|
|
87
87
|
|
|
@@ -147,15 +147,15 @@ wrap, text })`, then `setRows`, `refresh()`, `show()`/`hide()`, `moveSelection(
|
|
|
147
147
|
`rows`, `selected`, `selectedIndex`, `isVisible`, `cancelable`, `keyboardEnabled`, and the signals
|
|
148
148
|
`onSelectionChanged`, `onActivated`, `onBack`.
|
|
149
149
|
|
|
150
|
-
| Row `kind`
|
|
151
|
-
|
|
|
152
|
-
| `"action"`
|
|
153
|
-
| `"toggle"`
|
|
154
|
-
| `"slider"`
|
|
155
|
-
| `"choice"`
|
|
156
|
-
| `"binding"`
|
|
157
|
-
| `"heading"`
|
|
158
|
-
| `"separator"` | a rule; never selected
|
|
150
|
+
| Row `kind` | What it declares, on top of `id`, `label` and `enabled?` |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| `"action"` | `activate?()`, and an optional right-hand `value` |
|
|
153
|
+
| `"toggle"` | `get`/`set` a boolean; drawn with the menu's `text.on`/`.off` |
|
|
154
|
+
| `"slider"` | `min`/`max`/`step` plus `get`/`set`, and an optional `format` |
|
|
155
|
+
| `"choice"` | `values` plus `get`/`set` a string, and an optional `format` |
|
|
156
|
+
| `"binding"` | `path()` and `rebind?()`, and an optional `listening()` |
|
|
157
|
+
| `"heading"` | a label that groups the rows under it; never selected |
|
|
158
|
+
| `"separator"` | a rule; never selected |
|
|
159
159
|
|
|
160
160
|
`label` (and `title`, `subtitle`, `text.*`) is a string **or** a function, re-read on every
|
|
161
161
|
`refresh()` — which is what makes a menu localizable.
|
|
@@ -169,7 +169,7 @@ is how the widget reaches a gamepad without importing the package.
|
|
|
169
169
|
**`app.i18n`** — `load(handleOrAsset)`, `t(key, params)`, `has(key)`, `locale`, `fallbackLocale`,
|
|
170
170
|
`availableLocales`, `onLocaleChanged`.
|
|
171
171
|
|
|
172
|
-
Full signatures: `skills/ignifx/references/api/ui.md
|
|
172
|
+
Full signatures: `skills/ignifx/references/api/ui.md` in the `ignifx` package.
|
|
173
173
|
|
|
174
174
|
## Recipes
|
|
175
175
|
|
|
@@ -303,7 +303,7 @@ changes; `i18nKey` wins over `text`.
|
|
|
303
303
|
Supported: `{name}` interpolation, `{n, plural, …}` with `=0`-style exact matches, the CLDR
|
|
304
304
|
categories for the active locale, and `#` for the number. Not supported: `select`, number and date
|
|
305
305
|
skeletons, and ICU's apostrophe quoting — braces are structural, so a literal brace arrives as a
|
|
306
|
-
parameter. Field reference: `skills/ignifx/references/formats/ignifx.i18n.md
|
|
306
|
+
parameter. Field reference: `skills/ignifx/references/formats/ignifx.i18n.md` in the `ignifx` package.
|
|
307
307
|
|
|
308
308
|
## Gotchas
|
|
309
309
|
|
|
@@ -351,5 +351,6 @@ None (pre-1.0: no deprecation window; breaking changes are listed in the changel
|
|
|
351
351
|
|
|
352
352
|
## Where to look next
|
|
353
353
|
|
|
354
|
-
`skills/ignifx/SKILL.md`
|
|
355
|
-
|
|
354
|
+
The entry skill is `skills/ignifx/SKILL.md` in the `ignifx` package: `node_modules/ignifx/` in an
|
|
355
|
+
installed project, the repository root in the engine repository. Under it, `references/api/ui.md` has every exact signature and
|
|
356
|
+
`references/formats/ignifx.i18n.md` the translation file's fields.
|