@origingame/engine 0.1.1 → 0.3.0

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.
Files changed (109) hide show
  1. package/bin/og.mjs +1 -1
  2. package/dist/web/origin-engine.d.ts +219 -5
  3. package/dist/web/origin-engine.js +1344 -125
  4. package/dist/web/origin-engine_bg.wasm +0 -0
  5. package/dist/web/origin-engine_bg.wasm.d.ts +68 -3
  6. package/dist/web-publish/origin-engine-lanes.js +1007 -22
  7. package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
  8. package/dist/web-publish/origin-engine.d.ts +162 -5
  9. package/dist/web-publish/origin-engine.js +1004 -19
  10. package/dist/web-publish/origin-engine_bg.wasm +0 -0
  11. package/dist/web-publish/origin-engine_bg.wasm.d.ts +52 -3
  12. package/dist/web-publish-2d/origin-engine-lanes.js +1007 -22
  13. package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
  14. package/dist/web-publish-2d/origin-engine.d.ts +162 -5
  15. package/dist/web-publish-2d/origin-engine.js +1004 -19
  16. package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
  17. package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +52 -3
  18. package/knowledge/looks/catalogue.json +40 -40
  19. package/knowledge/package.json +4 -4
  20. package/knowledge/scaffold/distribution.json +14 -0
  21. package/knowledge/scaffold/origin-engine.json +2 -2
  22. package/knowledge/scaffold/template/README.md +2 -1
  23. package/knowledge/scaffold/template/assets/audio/sting.ogt +10 -0
  24. package/knowledge/scaffold/template/assets/timelines/intro.ogt +101 -0
  25. package/knowledge/scaffold/template/assets/timelines/narration.srt +11 -0
  26. package/knowledge/scaffold/template/host.d.ts +46 -0
  27. package/knowledge/scaffold/template/package.json +1 -1
  28. package/knowledge/scaffold/template/project.ogt +1 -1
  29. package/knowledge/scaffold/template/src/main.ts +1 -1
  30. package/knowledge/scaffold/template/tests/frames.ts +134 -0
  31. package/knowledge/scaffold/template/tests/intro.og.ts +65 -0
  32. package/knowledge/scaffold/template/tests/smoke.og.ts +30 -36
  33. package/knowledge/scaffold/template/tsconfig.json +1 -1
  34. package/knowledge/scripts/mount.ts +2 -1
  35. package/knowledge/scripts/validate.ts +21 -11
  36. package/knowledge/skills/og-build/SKILL.md +25 -6
  37. package/knowledge/skills/og-core/SKILL.md +11 -0
  38. package/knowledge/skills/og-feel/SKILL.md +8 -1
  39. package/knowledge/skills/og-game/SKILL.md +994 -21
  40. package/knowledge/skills/og-i18n/SKILL.md +12 -3
  41. package/knowledge/skills/og-platform-sdk/SKILL.md +4 -1
  42. package/knowledge/skills/og-taste/SKILL.md +82 -73
  43. package/knowledge/skills/og-ui/SKILL.md +82 -54
  44. package/knowledge/wiki/ai.md +20 -20
  45. package/knowledge/wiki/anim.md +384 -41
  46. package/knowledge/wiki/atmosphere.md +36 -13
  47. package/knowledge/wiki/audio.md +18 -18
  48. package/knowledge/wiki/camera.md +19 -13
  49. package/knowledge/wiki/commands.md +19 -13
  50. package/knowledge/wiki/debug.md +414 -0
  51. package/knowledge/wiki/game.md +8 -8
  52. package/knowledge/wiki/i18n.md +7 -7
  53. package/knowledge/wiki/index.md +265 -7
  54. package/knowledge/wiki/input.md +47 -47
  55. package/knowledge/wiki/load.md +236 -68
  56. package/knowledge/wiki/math.md +2614 -7
  57. package/knowledge/wiki/nav.md +34 -34
  58. package/knowledge/wiki/net.md +340 -0
  59. package/knowledge/wiki/path.md +402 -0
  60. package/knowledge/wiki/physics.md +124 -106
  61. package/knowledge/wiki/platform.md +465 -31
  62. package/knowledge/wiki/probe.md +681 -67
  63. package/knowledge/wiki/reflect.md +15 -15
  64. package/knowledge/wiki/render.md +3904 -1897
  65. package/knowledge/wiki/rng.md +14 -14
  66. package/knowledge/wiki/stream.md +15 -15
  67. package/knowledge/wiki/system.md +8 -8
  68. package/knowledge/wiki/systems.md +2 -2
  69. package/knowledge/wiki/terrain.md +19 -19
  70. package/knowledge/wiki/tilemap.md +19 -15
  71. package/knowledge/wiki/time.md +4 -4
  72. package/knowledge/wiki/timeline.md +396 -0
  73. package/knowledge/wiki/transform.md +8 -8
  74. package/knowledge/wiki/tween.md +17 -17
  75. package/knowledge/wiki/ui.md +603 -629
  76. package/knowledge/wiki/video.md +157 -0
  77. package/knowledge/wiki/world.md +67 -37
  78. package/package.json +7 -6
  79. package/schema/api.schema.json +21071 -13964
  80. package/shell/page.ts +26 -2
  81. package/shell/platform.ts +46 -0
  82. package/shell/player.ts +7 -0
  83. package/src/depth.ts +71 -0
  84. package/src/e6.ts +32 -1
  85. package/src/env.d.ts +5 -1
  86. package/src/generated/abi.ts +189 -3
  87. package/src/index.ts +26 -4
  88. package/src/light.ts +18 -0
  89. package/src/math.ts +622 -0
  90. package/src/node/index.ts +17 -0
  91. package/src/node/playtest-run.ts +114 -18
  92. package/src/node/polish.ts +15 -4
  93. package/src/node/render.ts +291 -0
  94. package/src/node/run.ts +91 -6
  95. package/src/p2.ts +19 -1
  96. package/src/playtest.ts +57 -4
  97. package/src/runtime.ts +15 -3
  98. package/src/targets.ts +28 -0
  99. package/src/trace.ts +169 -0
  100. package/src/ui-kit/huds.ts +49 -45
  101. package/src/ui-kit/menus.ts +12 -12
  102. package/src/ui-kit/settings.ts +2 -2
  103. package/src/ui-kit/store.ts +18 -18
  104. package/src/ui-kit/story.ts +6 -4
  105. package/src/ui-kit/util.ts +8 -8
  106. package/src/web/shell.ts +58 -0
  107. package/src/web/worker.ts +103 -2
  108. package/types/bindings.json +8945 -6456
  109. package/types/index.d.ts +15507 -11437
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: og-ui
3
- description: Game screens and HUDs on Origin Engine with og.ui — which screen template to pick (title, pause, settings, five HUDs, cutscene, shop, inventory, level select, results, leaderboard, tutorial, loading, dialogs, toasts), how to feed it data and read what it answers, the widget set beneath, focus for keyboard and gamepad, accessibility (the screen-reader mirror), phones, touch gestures and the safe area, text (fields, text areas, selection and the clipboard, input methods, ellipsis, kerning, shaping, font fallback), and the look: skins (style packs) and how their frames tile, count-ups, bursts, shakes, screen transitions and UI sounds. Use when building or changing menus, HUDs or any UI in a project with a project.ogt.
3
+ description: Game screens and HUDs on Origin Engine with og.ui — which screen template to pick (title, pause, settings, five HUDs, cutscene, shop, inventory, level select, results, leaderboard, tutorial, loading, dialogs, toasts), how to feed it data and read what it answers, the widget set beneath, focus for keyboard and gamepad, accessibility (the screen-reader mirror), phones, touch gestures and the safe area, text (fields, text areas, selection and the clipboard, input methods, ellipsis, kerning, shaping, font fallback), and the look: UI styles (a look's `ui` line, the six built-ins, the game's own) and how their frames tile, count-ups, bursts, shakes, screen transitions and UI sounds. Use when building or changing menus, HUDs or any UI in a project with a project.ogt.
4
4
  ---
5
5
 
6
6
  `og.ui` is the engine's immediate-mode UI: a system describes the tree every
@@ -14,7 +14,7 @@ Two games written from this package alone (`examples/lantern-vale`,
14
14
  `examples/hollowbell`) used the main menu, pause, cutscene, shop and
15
15
  results templates (the results with a localised Best and New best) and a
16
16
  text field with input-method composition, and none needed wiring beyond
17
- its desc; a skin pack copied into the game restyled every screen, and
17
+ its desc; a style copied into the game restyled every screen, and
18
18
  `og polish` measured taste 99 for both. The Kestrel Stair
19
19
  (`examples/kestrel-stair`) used the cutscene, tutorial overlay,
20
20
  inventory with drag and drop, level select, leaderboard with its honest
@@ -50,17 +50,17 @@ if (r.closed) state.screen = "map";
50
50
  Screenshots of every template at desktop (1280×720) and on a phone in portrait
51
51
  (390×844 at 3×) are in the engine repository under `templates/ui-kit/screens/`;
52
52
  the full-size reference frames are `crates/og-ui/references/metal/kit-*.png`,
53
- and every style pack's screens on a phone `kit-skin-<pack>-phone.png`.
53
+ and every style pack's screens on a phone `kit-style-<pack>-phone.png`.
54
54
 
55
55
  | The game needs | Call | It answers |
56
56
  |---|---|---|
57
57
  | A title screen | `og.ui.mainMenu(id, { title, subtitle, items, footer, instant })` (`instant` while it is the screen the game opens on: §6) | `selected`: the item id |
58
58
  | Pause | `og.ui.pauseMenu(id, { open, items })` (Resume, Settings, Quit by default) | `selected`; Back answers `resume` |
59
59
  | Settings | `og.ui.settingsScreen(id, { open, settings, languages, onChange, onSave })` | the new `GameSettings`, `changed`, `closed` |
60
- | A platformer HUD | `og.ui.platformerHud(id, { lives, maxLives, coins, score, level, timeLeft, touch })` (what it is not given it does not draw: `maxLives: 0` no hearts, no `coins` or `score` no capsule for them) | `paused`, `moveX`, `action: "jump"` |
61
- | A shooter HUD | `og.ui.shooterHud(id, { health, armor, ammo, reserve, abilities, map, touch })` | `paused`, `action` (ability id, `fire`), stick |
62
- | A puzzle HUD | `og.ui.puzzleHud(id, { level, score, target, stars, moves, timeLeft })` | `paused` |
63
- | An idle or incremental HUD | `og.ui.idleHud(id, { currencies, generators, tapLabel })` | `action: "tap"` or `"buy:<id>"` |
60
+ | A platformer HUD | `og.ui.platformerHud(id, { lives, maxLives, coins, score, level, timeLeft, touch })` (what it is not given it does not draw: `maxLives: 0` no hearts, no `coins` or `score` no box for them; the words `pauseLabel`, `jumpLabel` from the string table, og-i18n §2) | `paused`, `moveX`, `action: "jump"` |
61
+ | A shooter HUD | `og.ui.shooterHud(id, { health, armor, ammo, reserve, abilities, map, touch })` (the words `killsLabel`, `fireLabel`, `pauseLabel`) | `paused`, `action` (ability id, `fire`), stick |
62
+ | A puzzle HUD | `og.ui.puzzleHud(id, { level, score, target, stars, moves, timeLeft })` (the words `movesLabel`, `targetLabel` with `{target}`, `pauseLabel`) | `paused` |
63
+ | An idle or incremental HUD | `og.ui.idleHud(id, { currencies, generators })` (the words `tapLabel`, `levelLabel` with `{level}`, `rateLabel` with `{rate}`, `pauseLabel`) | `action: "tap"` or `"buy:<id>"` |
64
64
  | A racing HUD | `og.ui.racingHud(id, { speed, gear, lap, laps, position, racers, time, delta, best, splits, boost, map, touch })` (a time trial: `racers: 0` hides the place, `boostMeter: false` the meter, `delta` and `splits: [{ label, time, delta }]` show its sectors; the words `lapLabel`, `bestLabel`, `pauseLabel`, `boostLabel`, `brakeLabel`, `leftLabel`, `rightLabel`, `unit` from the string table, og-i18n §2) | `paused`, steering, `held` |
65
65
  | Dialogue or a cutscene | `og.ui.cutscene(id, { open, lines, index })` | the next `index`, `finished`, `skipped` |
66
66
  | A shop | `og.ui.shopScreen(id, { balance, currency, items, categories })` | `bought`, `refused` (Buy pressed short of the price: it shook with the error sound), `closed` |
@@ -143,9 +143,9 @@ its own names `coin`, `gear`, `fire`…, and every kit screen draws them) loads
143
143
  { font } })`; `og.ui.icon(id, "heart", { size, tint })` and `[icon=heart]`
144
144
  then draw crisp distance-field glyphs at any size in their ink. A texture
145
145
  grid (`icons: { texture, columns, rows, names }`) still works for painted
146
- icons. Icons sit in `fgMuted` or `fgSubtle` (design language: icons are
147
- neutral). Sets name their icons differently (iconoir's `coins` and
148
- `fire-flame`, the skin grids' `coin` and `fire`): an unknown name draws an
146
+ icons. Icons sit in `inkMuted` or `inkFaint` (icons stay neutral; colour
147
+ is for state). Sets name their icons differently (iconoir's `coins` and
148
+ `fire-flame`, the style grids' `coin` and `fire`): an unknown name draws an
149
149
  empty slot and warns, so a template that may meet either asks
150
150
  `og.ui.hasIcon(name)` first and draws its fallback, or names an icon twice
151
151
  in its set (`icon "coin" "coins"`). A path's `stroke-linejoin` is kept
@@ -212,8 +212,13 @@ through). A gameplay HUD whose keys
212
212
  move the player calls `og.ui.setNavigation(false)` (the HUD templates do);
213
213
  dialogs turn navigation back on while open. What opens takes the focus:
214
214
  a dialog (every modal template: pause, settings, shop, results, confirm)
215
- its first control, a dialogue box or cutscene the box, so Enter, Space and
216
- A answer it at once without a Tab first. The UI reads pad 0 from
215
+ its first control, a dialogue box or cutscene the box, without a Tab first.
216
+ An entering panel is inert until its entrance finishes: Enter, Space, A
217
+ and pointer presses during that motion are ignored, not buffered. Its
218
+ controls answer once the panel arrives, even if their stagger continues.
219
+ Use `instant: true` on a `mainMenu` or `anchor` to skip its entrance when
220
+ immediate input is needed (for example under a screen wipe, §6).
221
+ The UI reads pad 0 from
217
222
  `og.Gamepad` itself (d-pad, A, B, the left stick); for a custom binding,
218
223
  queue intents with `og.ui.navigate(world, intent)`. A focus move plays the
219
224
  `hover` sound and Enter, Space or A the `press` sound, as the pointer does
@@ -279,46 +284,60 @@ fingers with `touch_start` for the first and `touch:1:down:<x,y>` /
279
284
  `touch:1:move:<x,y>` / `touch:1:up` for the second
280
285
  (`templates/ui-kit/tests/gestures.og.ts`).
281
286
 
282
- ## 6. Theming: skins, motion, transitions, sounds
283
-
284
- The default look is the platform's tokens; a game should have its own. A
285
- **skin** (`og.load.skin`, an `.ogt` of `type skin`) replaces the palette,
286
- radii, type ramp, durations, fonts and icons, and dresses every element
287
- class in nine-slice frames from its atlas (panel, card, button with hover,
288
- pressed and disabled, field, slot, tooltip, HUD capsule, progress track and
289
- fill), with ornaments (panel corners, the divider, a heading flourish), a
290
- panel texture, shadows and glows, press squash and hover lift, entrances and
291
- sounds. Choosing one is og-taste §1. Six packs to start from are in
292
- the engine repository under `templates/ui-kit/assets/skins/` (`pixel`,
293
- `cartoon`, `fantasy`, `scifi`, `paper`, `neon`; copy the directory into the
294
- game's `assets/skins/` and rename it at will: a skin's ids are read
295
- relative to its file first, then from `assets/`; og-taste §1 has the one
296
- line to check, the CJK `fallback`):
287
+ ## 6. Styles: the look of the game's UI, motion, transitions, sounds
288
+
289
+ The game's UI follows the game's art, never the Origin platform's look:
290
+ the engine has no house style to fall back on. Without a style a UI draws
291
+ in **prototype**, the engine's placeholder: greys, near-square corners and
292
+ a cyan focus ring, meant to be replaced. `og polish` warns when a game
293
+ ships in it. A **style** (`og.load.style`, an `.ogt` of `type style`) is
294
+ complete: its scheme, every palette role (`backdrop`, `panel`, `ink`,
295
+ `inkMuted`, `primary`, `focus`, `hud`, `danger`, ...), the four radii
296
+ (`small`, `control`, `bar`, `panel`), the type ramp, durations, fonts and
297
+ icons. It dresses every element class in nine-slice frames from its atlas
298
+ (panel, card, button with hover, pressed and disabled, field, slot,
299
+ tooltip, HUD box, progress track and fill), with ornaments (panel corners,
300
+ the divider, a heading flourish), a panel texture, shadows and glows,
301
+ press squash and hover lift, entrances and sounds. Choosing one is
302
+ og-taste §1.
303
+
304
+ The usual way in is the game's look (og-taste §12): its `ui` line names
305
+ the style, and every catalogue preset already names one. `ui "pixel"` is a
306
+ built-in style by slug (`pixel`, `cartoon`, `fantasy`, `scifi`, `paper`,
307
+ `neon`; `og cook` bundles the one a look names). `ui
308
+ "styles/<name>/style.ogt"` is the game's own, and a game's
309
+ `assets/styles/<slug>/style.ogt` wins over the built-in of that slug.
310
+ To make one from a built-in, copy `templates/styles/<slug>/` of the
311
+ engine repository into the game's `assets/styles/<name>/` and change it
312
+ at will: a style's ids are read relative to its file first, then from
313
+ `assets/`. A style file must name every palette role and all four radii;
314
+ `og cook` lists the ones missing. Loading one by hand:
297
315
 
298
316
  ```ts
299
- const skin = og.load.skin(world, "skins/fantasy/skin.ogt"); // atlas, fonts, icons load with it
317
+ const style = og.load.style(world, "styles/fantasy/style.ogt"); // atlas, fonts, icons load with it
300
318
  og.ui.configure(world, {
301
- skin: skin.ok ? skin.value : null,
302
- contrast: "high", // still applies over a skin
319
+ style: style.ok ? style.value : null,
320
+ contrast: "high", // still applies over a style
303
321
  reducedMotion: settings.reducedMotion, // every motion becomes a fade
304
322
  sounds: { hover, press, open, close, success, error }, // og.load.sound handles, played on the ui bus
305
323
  });
306
- og.ui.configure(world, { reducedMotion: true }); // later, from the settings: the skin, fonts and sounds stay
324
+ og.ui.configure(world, { reducedMotion: true }); // later, from the settings: the style, fonts and sounds stay
325
+ og.ui.configure(world, { primaryColor: "#e0553b" }); // re-colour the style's primary; hover, pressed and the ink on it follow
307
326
  ```
308
327
 
309
328
  `configure` takes a partial UiDesc: a field left out keeps the value the
310
- last call gave it (or the skin a look applied, `GameDesc.look` and
311
- `og.render.applyLook`), and `null` clears one (`skin: null` is the
312
- platform tokens again). A UI left with no font at all warns that it draws
329
+ last call gave it (or the style a look applied, `GameDesc.look` and
330
+ `og.render.applyLook`), and `null` clears one (`style: null` is the
331
+ prototype style again). A UI left with no font at all warns that it draws
313
332
  no text.
314
333
 
315
- A skin's `slice` line says how a frame's edges and centre fill: `stretch`
334
+ A style's `slice` line says how a frame's edges and centre fill: `stretch`
316
335
  (the default), `repeat` (tiled at the art's size from the corner, the last
317
336
  tile cut) or `round` (a whole number of tiles resized to fit, as CSS
318
337
  `round`): tile patterned borders (a rope, a rivet row, a pixel bevel),
319
338
  stretch plain ones. `glass <part> <blur> <fill> [tint]` makes a part glass:
320
339
  the game behind it blurred (`blur` CSS px), tinted by the part's fill, under
321
- its frame drawn at `fill` opacity (the scifi pack's dialogs:
340
+ its frame drawn at `fill` opacity (the scifi style's dialogs:
322
341
  `glass panel 16 0.85 0.15`). Glass blurs the scene and the UI drawn under
323
342
  it (a HUD under a glass dialog); it costs a frame copy and a blur pyramid
324
343
  when any is on screen (about 0.8 ms at 1280×720 on an M4 Pro), and one more
@@ -330,35 +349,44 @@ translucent fills (secondary buttons, chips, tracks) flat. Your own
330
349
  see-through overlays should follow: read `og.ui.frameTheme().reducedTransparency`
331
350
  (and `reducedMotion`) and draw them opaque.
332
351
 
333
- A skin of the game's own art: draw each part as a nine-patch PNG
352
+ A style of the game's own art: draw each part as a nine-patch PNG
334
353
  (`panel.9.png`, `button.9.png`, `buttonHover.9.png`, ..., `soft.9.png`: the
335
354
  art inside a one-pixel border whose top row and left column mark in opaque
336
355
  black what stretches) and any ornament as a plain PNG (`corner.png`,
337
- `divider.png`, `flourish.png`, `tile.png`) in the skin's directory, then
338
- `og skin pack assets/skins/<name>`: it packs them into `atlas.png` and
339
- writes the skin file's `atlas`, `slice` and `soft` lines and the ornaments'
340
- regions, keeping every other line (palette, fonts, a slice's `tint` or
356
+ `divider.png`, `flourish.png`, `tile.png`) in the style's directory, then
357
+ `og style pack assets/styles/<name>`: it packs them into `atlas.png` and
358
+ writes the style file's `atlas`, `slice` and `soft` lines and the ornaments'
359
+ regions, keeping every other line (palette, radii, fonts, a slice's `tint` or
341
360
  `repeat`). Re-run it after redrawing a part.
342
361
 
343
- Never pass hex colours for chrome: use `{ token: "accent" }`, `"fgMuted"`,
344
- `"surface"` and the type steps (`displayLg`, `xl`, `meta`); the skin's
345
- palette answers them. A container that should look like a HUD capsule or a
346
- card takes `frame: "capsule"` (or `"card"`, `"slot"`…) in its desc; titles
347
- take `heading: true`. Without a skin both are plain.
362
+ Never pass hex colours for chrome: use `{ token: "primary" }`, `"inkMuted"`,
363
+ `"panel"` and the type steps (`xl3`, `xl`, `meta`); the style's
364
+ palette answers them. A container that should look like a HUD box or a
365
+ card takes `frame: "hud"` (or `"card"`, `"slot"`…) in its desc; titles
366
+ take `heading: true`. Without a frame atlas both are plain fills at the
367
+ style's radii.
348
368
 
349
369
  Motion and juice, all by the tick and in the UI state:
350
370
 
351
371
  | Want | Call |
352
372
  |---|---|
353
- | A score, coins or a reward counting up | `og.ui.counter(id, value, { from: 0, font: "display", step: "displayLg" })` |
373
+ | A score, coins or a reward counting up | `og.ui.counter(id, value, { from: 0, font: "display", step: "xl3" })` |
354
374
  | Sparks when a star or reward lands | `og.ui.burst({ count: 10 })` right after the element |
355
375
  | A panel or item popping in | `og.ui.transition(id, show, { kind: "pop" })` (also `fade`, `slideUp`…, `scale`) |
356
376
  | A change of game screen | `const s = og.ui.screenTransition("Screens", state.screen, { kind: "iris" }).shown;` then build `s` (`fade`, `wipe`, `iris`, `dissolve`, `slide`; a colour or a texture) |
357
- | A wrong answer, a locked door, a refused purchase | `og.ui.shake({ sound: true })` right after the element, once, on the tick it happens: it swings three times and comes to rest by itself (the skin's `motion.shake`, else 6 px), with the `error` sound |
377
+ | A wrong answer, a locked door, a refused purchase | `og.ui.shake({ sound: true })` right after the element, once, on the tick it happens: it swings three times and comes to rest by itself (the style's `motion.shake`, else 6 px), with the `error` sound |
358
378
 
359
- Skins add the rest themselves: dialog and panel entrances with staggered
379
+ `screenTransition` keeps the previous screen in `shown` for the closing
380
+ half of its duration, switches at full cover, then reveals the new one.
381
+ Build `shown`, not the requested screen; `dump_ui` therefore lists the old
382
+ screen until the midpoint. The cover itself does not block input. A new
383
+ panel's own style entrance starts when that panel is first built, and
384
+ ignores presses until it arrives (§4): the closing half of a wipe plus
385
+ that entrance explains why a press just after the switch can be lost.
386
+
387
+ Styles add the rest themselves: dialog and panel entrances with staggered
360
388
  controls, hover lift and press squash on springs (the `hoverSpring 1 350` and `pressSpring 0.55 120` lines of a
361
- skin's `motion` block: damping ratio and response in ms; below 1 bounces), eased progress bars, toasts flying in,
389
+ style's `motion` block: damping ratio and response in ms; below 1 bounces), eased progress bars, toasts flying in,
362
390
  a shake and the error sound on a press of a disabled button. Reduced motion
363
391
  keeps every shake still and turns the rest into fades. The screen the game
364
392
  opens on is built settled (`instant: true` on its `mainMenu`, `anchor` or
@@ -375,7 +403,7 @@ scripts are shaped (Arabic joins, Devanagari conjuncts) and every font's
375
403
  kerning pairs apply. What a game sets:
376
404
 
377
405
  ```ts
378
- og.ui.label("Quest", quest.text, { width: { kind: "grow" }, maxLines: 2, ellipsis: true, color: { token: "fgMuted" } }); // cut with … on the last line
406
+ og.ui.label("Quest", quest.text, { width: { kind: "grow" }, maxLines: 2, ellipsis: true, color: { token: "inkMuted" } }); // cut with … on the last line
379
407
  og.ui.label("Gold", gold, { font: "rounded", step: "xl", nowrap: true }); // body, display, mono or rounded
380
408
  ```
381
409
 
@@ -417,7 +445,7 @@ script text with `type:`, not `key_down`.
417
445
 
418
446
  Fonts (the one rule for every label, field and button):
419
447
 
420
- 1. The role's font (body, display, mono, rounded; the skin's or
448
+ 1. The role's font (body, display, mono, rounded; the style's or
421
449
  `og.ui.configure`'s) when it has every character: the whole label in it.
422
450
  2. Else the first of the locale's fonts (its string table's `fonts` line)
423
451
  that has every character: the whole label in that face, its Latin and
@@ -426,9 +454,9 @@ Fonts (the one rule for every label, field and button):
426
454
  3. Else run by run: each run of the label from the first font that has it,
427
455
  the role's font first, then the locale's fonts, `UiDesc.fallbackFonts`
428
456
  (a Hebrew or Devanagari face, a CJK face cooked with `runtime true`) and
429
- the skin's `fallback`; a letter and its accents stay in one face. A
457
+ the style's `fallback`; a letter and its accents stay in one face. A
430
458
  CJK-only subset (lantern-vale's `tools/subset-font.py`) gives this: the
431
- Latin in the skin's face, the Chinese in Noto, on one line.
459
+ Latin in the style's face, the Chinese in Noto, on one line.
432
460
 
433
461
  So choose by the subset: keep Latin in the CJK subset for one face per
434
462
  label, leave it out to keep the game's Latin face beside CJK. Tracking
@@ -18,7 +18,7 @@ module ai {
18
18
  # declarations follow, each quoted below
19
19
  ```
20
20
 
21
- <sub>`api.ogt` line 7262</sub>
21
+ <sub>`api.ogt` line 8923</sub>
22
22
 
23
23
  ## Contents
24
24
 
@@ -74,7 +74,7 @@ fn load {
74
74
  }
75
75
  ```
76
76
 
77
- <sub>`api.ogt` line 7434</sub>
77
+ <sub>`api.ogt` line 9095</sub>
78
78
 
79
79
  <a id="fn-parse"></a>
80
80
 
@@ -104,7 +104,7 @@ fn parse {
104
104
  }
105
105
  ```
106
106
 
107
- <sub>`api.ogt` line 7441</sub>
107
+ <sub>`api.ogt` line 9102</sub>
108
108
 
109
109
  <a id="fn-get"></a>
110
110
 
@@ -136,7 +136,7 @@ fn get {
136
136
  }
137
137
  ```
138
138
 
139
- <sub>`api.ogt` line 7448</sub>
139
+ <sub>`api.ogt` line 9109</sub>
140
140
 
141
141
  <a id="fn-set"></a>
142
142
 
@@ -170,7 +170,7 @@ fn set {
170
170
  }
171
171
  ```
172
172
 
173
- <sub>`api.ogt` line 7456</sub>
173
+ <sub>`api.ogt` line 9117</sub>
174
174
 
175
175
  <a id="fn-restart"></a>
176
176
 
@@ -200,7 +200,7 @@ fn restart {
200
200
  }
201
201
  ```
202
202
 
203
- <sub>`api.ogt` line 7465</sub>
203
+ <sub>`api.ogt` line 9126</sub>
204
204
 
205
205
  <a id="fn-noise"></a>
206
206
 
@@ -230,7 +230,7 @@ fn noise {
230
230
  }
231
231
  ```
232
232
 
233
- <sub>`api.ogt` line 7472</sub>
233
+ <sub>`api.ogt` line 9133</sub>
234
234
 
235
235
  <a id="fn-describe"></a>
236
236
 
@@ -260,7 +260,7 @@ fn describe {
260
260
  }
261
261
  ```
262
262
 
263
- <sub>`api.ogt` line 7479</sub>
263
+ <sub>`api.ogt` line 9140</sub>
264
264
 
265
265
  ## Components, resources and events
266
266
 
@@ -310,7 +310,7 @@ component AiAgent {
310
310
  }
311
311
  ```
312
312
 
313
- <sub>`api.ogt` line 7281</sub>
313
+ <sub>`api.ogt` line 8942</sub>
314
314
 
315
315
  <a id="record-Perception"></a>
316
316
 
@@ -411,7 +411,7 @@ component Perception {
411
411
  }
412
412
  ```
413
413
 
414
- <sub>`api.ogt` line 7307</sub>
414
+ <sub>`api.ogt` line 8968</sub>
415
415
 
416
416
  <a id="record-Perceivable"></a>
417
417
 
@@ -440,7 +440,7 @@ component Perceivable {
440
440
  }
441
441
  ```
442
442
 
443
- <sub>`api.ogt` line 7377</sub>
443
+ <sub>`api.ogt` line 9038</sub>
444
444
 
445
445
  <a id="record-AiChanged"></a>
446
446
 
@@ -467,7 +467,7 @@ event AiChanged {
467
467
  }
468
468
  ```
469
469
 
470
- <sub>`api.ogt` line 7389</sub>
470
+ <sub>`api.ogt` line 9050</sub>
471
471
 
472
472
  ## Types
473
473
 
@@ -483,7 +483,7 @@ A generational handle: a number the engine hands out. A dead handle is an error
483
483
  handle Behaviour "A loaded behaviour tree or state machine."
484
484
  ```
485
485
 
486
- <sub>`api.ogt` line 7268</sub>
486
+ <sub>`api.ogt` line 8929</sub>
487
487
 
488
488
  <a id="type-BehaviourInfo"></a>
489
489
 
@@ -512,7 +512,7 @@ struct BehaviourInfo {
512
512
  }
513
513
  ```
514
514
 
515
- <sub>`api.ogt` line 7397</sub>
515
+ <sub>`api.ogt` line 9058</sub>
516
516
 
517
517
  <a id="type-NoiseDesc"></a>
518
518
 
@@ -544,7 +544,7 @@ struct NoiseDesc {
544
544
  }
545
545
  ```
546
546
 
547
- <sub>`api.ogt` line 7407</sub>
547
+ <sub>`api.ogt` line 9068</sub>
548
548
 
549
549
  <a id="type-AiDescription"></a>
550
550
 
@@ -579,7 +579,7 @@ struct AiDescription {
579
579
  }
580
580
  ```
581
581
 
582
- <sub>`api.ogt` line 7421</sub>
582
+ <sub>`api.ogt` line 9082</sub>
583
583
 
584
584
  ## Column kinds
585
585
 
@@ -598,7 +598,7 @@ column Behaviour {
598
598
  }
599
599
  ```
600
600
 
601
- <sub>`api.ogt` line 7270</sub>
601
+ <sub>`api.ogt` line 8931</sub>
602
602
 
603
603
  ## Constants
604
604
 
@@ -612,16 +612,16 @@ column Behaviour {
612
612
  const AI_RUNNING u32 1 "AiAgent.status: the tree or state is still running."
613
613
  ```
614
614
 
615
- <sub>`api.ogt` line 7277</sub>
615
+ <sub>`api.ogt` line 8938</sub>
616
616
 
617
617
  ```ogt
618
618
  const AI_SUCCESS u32 2 "AiAgent.status: the tree succeeded on the last think."
619
619
  ```
620
620
 
621
- <sub>`api.ogt` line 7278</sub>
621
+ <sub>`api.ogt` line 8939</sub>
622
622
 
623
623
  ```ogt
624
624
  const AI_FAILURE u32 3 "AiAgent.status: the tree failed on the last think."
625
625
  ```
626
626
 
627
- <sub>`api.ogt` line 7279</sub>
627
+ <sub>`api.ogt` line 8940</sub>