@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.
- package/bin/og.mjs +1 -1
- package/dist/web/origin-engine.d.ts +219 -5
- package/dist/web/origin-engine.js +1344 -125
- package/dist/web/origin-engine_bg.wasm +0 -0
- package/dist/web/origin-engine_bg.wasm.d.ts +68 -3
- package/dist/web-publish/origin-engine-lanes.js +1007 -22
- package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish/origin-engine.d.ts +162 -5
- package/dist/web-publish/origin-engine.js +1004 -19
- package/dist/web-publish/origin-engine_bg.wasm +0 -0
- package/dist/web-publish/origin-engine_bg.wasm.d.ts +52 -3
- package/dist/web-publish-2d/origin-engine-lanes.js +1007 -22
- package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine.d.ts +162 -5
- package/dist/web-publish-2d/origin-engine.js +1004 -19
- package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +52 -3
- package/knowledge/looks/catalogue.json +40 -40
- package/knowledge/package.json +4 -4
- package/knowledge/scaffold/distribution.json +14 -0
- package/knowledge/scaffold/origin-engine.json +2 -2
- package/knowledge/scaffold/template/README.md +2 -1
- package/knowledge/scaffold/template/assets/audio/sting.ogt +10 -0
- package/knowledge/scaffold/template/assets/timelines/intro.ogt +101 -0
- package/knowledge/scaffold/template/assets/timelines/narration.srt +11 -0
- package/knowledge/scaffold/template/host.d.ts +46 -0
- package/knowledge/scaffold/template/package.json +1 -1
- package/knowledge/scaffold/template/project.ogt +1 -1
- package/knowledge/scaffold/template/src/main.ts +1 -1
- package/knowledge/scaffold/template/tests/frames.ts +134 -0
- package/knowledge/scaffold/template/tests/intro.og.ts +65 -0
- package/knowledge/scaffold/template/tests/smoke.og.ts +30 -36
- package/knowledge/scaffold/template/tsconfig.json +1 -1
- package/knowledge/scripts/mount.ts +2 -1
- package/knowledge/scripts/validate.ts +21 -11
- package/knowledge/skills/og-build/SKILL.md +25 -6
- package/knowledge/skills/og-core/SKILL.md +11 -0
- package/knowledge/skills/og-feel/SKILL.md +8 -1
- package/knowledge/skills/og-game/SKILL.md +994 -21
- package/knowledge/skills/og-i18n/SKILL.md +12 -3
- package/knowledge/skills/og-platform-sdk/SKILL.md +4 -1
- package/knowledge/skills/og-taste/SKILL.md +82 -73
- package/knowledge/skills/og-ui/SKILL.md +82 -54
- package/knowledge/wiki/ai.md +20 -20
- package/knowledge/wiki/anim.md +384 -41
- package/knowledge/wiki/atmosphere.md +36 -13
- package/knowledge/wiki/audio.md +18 -18
- package/knowledge/wiki/camera.md +19 -13
- package/knowledge/wiki/commands.md +19 -13
- package/knowledge/wiki/debug.md +414 -0
- package/knowledge/wiki/game.md +8 -8
- package/knowledge/wiki/i18n.md +7 -7
- package/knowledge/wiki/index.md +265 -7
- package/knowledge/wiki/input.md +47 -47
- package/knowledge/wiki/load.md +236 -68
- package/knowledge/wiki/math.md +2614 -7
- package/knowledge/wiki/nav.md +34 -34
- package/knowledge/wiki/net.md +340 -0
- package/knowledge/wiki/path.md +402 -0
- package/knowledge/wiki/physics.md +124 -106
- package/knowledge/wiki/platform.md +465 -31
- package/knowledge/wiki/probe.md +681 -67
- package/knowledge/wiki/reflect.md +15 -15
- package/knowledge/wiki/render.md +3904 -1897
- package/knowledge/wiki/rng.md +14 -14
- package/knowledge/wiki/stream.md +15 -15
- package/knowledge/wiki/system.md +8 -8
- package/knowledge/wiki/systems.md +2 -2
- package/knowledge/wiki/terrain.md +19 -19
- package/knowledge/wiki/tilemap.md +19 -15
- package/knowledge/wiki/time.md +4 -4
- package/knowledge/wiki/timeline.md +396 -0
- package/knowledge/wiki/transform.md +8 -8
- package/knowledge/wiki/tween.md +17 -17
- package/knowledge/wiki/ui.md +603 -629
- package/knowledge/wiki/video.md +157 -0
- package/knowledge/wiki/world.md +67 -37
- package/package.json +7 -6
- package/schema/api.schema.json +21071 -13964
- package/shell/page.ts +26 -2
- package/shell/platform.ts +46 -0
- package/shell/player.ts +7 -0
- package/src/depth.ts +71 -0
- package/src/e6.ts +32 -1
- package/src/env.d.ts +5 -1
- package/src/generated/abi.ts +189 -3
- package/src/index.ts +26 -4
- package/src/light.ts +18 -0
- package/src/math.ts +622 -0
- package/src/node/index.ts +17 -0
- package/src/node/playtest-run.ts +114 -18
- package/src/node/polish.ts +15 -4
- package/src/node/render.ts +291 -0
- package/src/node/run.ts +91 -6
- package/src/p2.ts +19 -1
- package/src/playtest.ts +57 -4
- package/src/runtime.ts +15 -3
- package/src/targets.ts +28 -0
- package/src/trace.ts +169 -0
- package/src/ui-kit/huds.ts +49 -45
- package/src/ui-kit/menus.ts +12 -12
- package/src/ui-kit/settings.ts +2 -2
- package/src/ui-kit/store.ts +18 -18
- package/src/ui-kit/story.ts +6 -4
- package/src/ui-kit/util.ts +8 -8
- package/src/web/shell.ts +58 -0
- package/src/web/worker.ts +103 -2
- package/types/bindings.json +8945 -6456
- 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:
|
|
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
|
|
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-
|
|
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
|
|
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
|
|
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 `
|
|
147
|
-
|
|
148
|
-
`fire-flame`, the
|
|
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,
|
|
216
|
-
|
|
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.
|
|
283
|
-
|
|
284
|
-
The
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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
|
|
317
|
+
const style = og.load.style(world, "styles/fantasy/style.ogt"); // atlas, fonts, icons load with it
|
|
300
318
|
og.ui.configure(world, {
|
|
301
|
-
|
|
302
|
-
contrast: "high", // still applies over a
|
|
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
|
|
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
|
|
311
|
-
`og.render.applyLook`), and `null` clears one (`
|
|
312
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
338
|
-
`og
|
|
339
|
-
writes the
|
|
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: "
|
|
344
|
-
`"
|
|
345
|
-
palette answers them. A container that should look like a HUD
|
|
346
|
-
card takes `frame: "
|
|
347
|
-
take `heading: true`. Without a
|
|
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: "
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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: "
|
|
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
|
|
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
|
|
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
|
|
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
|
package/knowledge/wiki/ai.md
CHANGED
|
@@ -18,7 +18,7 @@ module ai {
|
|
|
18
18
|
# declarations follow, each quoted below
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
<sub>`api.ogt` line
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
627
|
+
<sub>`api.ogt` line 8940</sub>
|