@moku-labs/game 0.15.94 → 0.15.97
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/dist/app/page.d.mts +1 -1
- package/dist/app/page.mjs +1 -1
- package/dist/app/system.d.mts +3 -3
- package/dist/app.d.mts +3 -3
- package/dist/app.mjs +1 -1
- package/dist/assets.d.mts +1 -1
- package/dist/{commands-B05keaNh.d.mts → commands-DQXSQB_C.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-C5oKi9M2.d.mts → define-hPbGjPAY.d.mts} +2 -2
- package/dist/{headless-rXLWKvZq.d.mts → headless-Co3SEFi5.d.mts} +1 -1
- package/dist/{index-DuiCPP3n.d.mts → index-U_AN5j0L.d.mts} +5 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -2
- package/dist/inspect.d.mts +6 -6
- package/dist/inspect.mjs +1 -1
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-DGpGGQAh.d.mts → runtime-B69fIYx_.d.mts} +1 -1
- package/dist/{sources-DIl02J8z.mjs → sources-Cqqz-0-b.mjs} +1 -1
- package/dist/{src-CkBzjWRd.mjs → src-C32BYdgi.mjs} +792 -196
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-CSkVNKPZ.d.mts → types-BE6tcAFX.d.mts} +2 -2
- package/dist/{types-CA98KS-U.d.mts → types-Brsj29M-.d.mts} +4 -4
- package/dist/{types-BrEqXapX.d.mts → types-Cffn9Rbm.d.mts} +18 -9
- package/dist/{types-DhCTe-kr.d.mts → types-L3E-YS4N.d.mts} +46 -3
- package/dist/{types-D33h-CNj.d.mts → types-qCcSw8YI.d.mts} +61 -16
- package/dist/{visual-BfN2jgqg.d.mts → visual-72OVwKM4.d.mts} +6 -6
- package/dist/{visual-Cl7Q7pO9.mjs → visual-DhqD6W3v.mjs} +15 -5
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +4 -4
- package/package.json +1 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { An as FeaturePlugin, Hn as Descriptor, Hr as Json, Ir as FakeClock, Kn as Hint, Mn as AnyFlow, Pr as ClockSource, Rn as NodeTable, qn as NodeFx } from "./types-
|
|
2
|
-
import { t as createApp } from "./index-
|
|
3
|
-
import { b as memory, x as saveOf, y as WithGameState } from "./types-
|
|
4
|
-
import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-
|
|
1
|
+
import { An as FeaturePlugin, Hn as Descriptor, Hr as Json, Ir as FakeClock, Kn as Hint, Mn as AnyFlow, Pr as ClockSource, Rn as NodeTable, qn as NodeFx } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { t as createApp } from "./index-U_AN5j0L.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-Brsj29M-.mjs";
|
|
4
|
+
import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-Co3SEFi5.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/clock/fake.d.ts
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as flattenFeatures, on as type, rn as exit, t as createApp, tn as refuseStart } from "./src-
|
|
1
|
+
import { m as flattenFeatures, on as type, rn as exit, t as createApp, tn as refuseStart } from "./src-C32BYdgi.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-CCiUwvlp.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Hr as Json, Zr as Snapshot } from "./types-
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Hr as Json, Zr as Snapshot } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-Co3SEFi5.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { An as FeaturePlugin, Br as Config, Hr as Json, Ir as FakeClock, Jr as ProviderCall, Mn as AnyFlow, Pr as ClockSource, Q as Config$2, Qr as SnapshotOf, Vn as TypeTag, Yr as SaveDoc, a as Config$3, d as Manifest, ht as Orientation, mn as Config$1, n as AssetsIo, nt as PixiModule, qr as PlayerStateProvider } from "./types-
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { H as I18nApi, J as TextKey, q as StringTable } from "./types-
|
|
4
|
-
import { Ct as effectsPlugin, Et as audioPlugin, gt as PlatformProvider, i as screen, mt as platformPlugin, t as createApp } from "./index-
|
|
1
|
+
import { An as FeaturePlugin, Br as Config, Hr as Json, Ir as FakeClock, Jr as ProviderCall, Mn as AnyFlow, Pr as ClockSource, Q as Config$2, Qr as SnapshotOf, Vn as TypeTag, Yr as SaveDoc, a as Config$3, d as Manifest, ht as Orientation, mn as Config$1, n as AssetsIo, nt as PixiModule, qr as PlayerStateProvider } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-Cffn9Rbm.mjs";
|
|
3
|
+
import { H as I18nApi, J as TextKey, q as StringTable } from "./types-L3E-YS4N.mjs";
|
|
4
|
+
import { Ct as effectsPlugin, Et as audioPlugin, gt as PlatformProvider, i as screen, mt as platformPlugin, t as createApp } from "./index-U_AN5j0L.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $n as Ease, A as FilterSlotQuad, Hn as Descriptor, Hr as Json, O as FilterSlot, Or as Api$3, Vn as TypeTag, Vr as Events$3, Xn as AnchorTarget, Z as Api$4, _i as Events$2, at as PixiUniformGroup, b as Events$4, ci as Api$1, cr as TrackOptions, dr as AnyComponent, et as PixiFilter, fn as Api$2, gr as ComponentType, gt as Point, ii as Events$5, it as PixiTexture, j as SyncApi, k as FilterSlotInputs, lr as TrackSegment, mr as ComponentHandle, nr as MotionHandle, nt as PixiModule, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, rt as PixiSprite, s as Events$1, t as Api$5, tt as PixiGpuProgram, vi as Require, vr as Entity, vt as FilterCache, zr as Api$6 } from "./types-
|
|
2
|
-
import { H as I18nApi, L as InputApi, T as TextApi, c as UiNode, et as StylesState, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-
|
|
1
|
+
import { $n as Ease, A as FilterSlotQuad, Hn as Descriptor, Hr as Json, O as FilterSlot, Or as Api$3, Vn as TypeTag, Vr as Events$3, Xn as AnchorTarget, Z as Api$4, _i as Events$2, at as PixiUniformGroup, b as Events$4, ci as Api$1, cr as TrackOptions, dr as AnyComponent, et as PixiFilter, fn as Api$2, gr as ComponentType, gt as Point, ii as Events$5, it as PixiTexture, j as SyncApi, k as FilterSlotInputs, lr as TrackSegment, mr as ComponentHandle, nr as MotionHandle, nt as PixiModule, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, rt as PixiSprite, s as Events$1, t as Api$5, tt as PixiGpuProgram, vi as Require, vr as Entity, vt as FilterCache, zr as Api$6 } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { H as I18nApi, L as InputApi, T as TextApi, c as UiNode, et as StylesState, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-L3E-YS4N.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -1475,9 +1475,11 @@ type FilterSpec<Uniforms extends Record<string, UniformDeclaration>> = {
|
|
|
1475
1475
|
* default) keeps it as a picture, also while the view moves; `"placed"` keeps it with its canvas origin, for a body
|
|
1476
1476
|
* that reads where it is drawn through `canvasPixel(uv)` (a body that calls the helper is placed by itself); set
|
|
1477
1477
|
* `false` for a body whose look depends on where the view is drawn in a way the engine cannot see (a time read from
|
|
1478
|
-
* a texture, a hash of the screen position):
|
|
1479
|
-
*
|
|
1480
|
-
*
|
|
1478
|
+
* a texture, a hash of the screen position): no output of it is kept. On WebGPU the view's subtree picture is kept
|
|
1479
|
+
* and the body runs on its quad in every frame, the canvas place in `uOutputFrame.xy`; on WebGL, or when it does not
|
|
1480
|
+
* fit the quad, it is drawn live in every frame. A body that reads `uGlobalFrame`, `@builtin(position)`,
|
|
1481
|
+
* `gl_FragCoord`, `uOutputTexture` or the origin of `uOutputFrame` and declares nothing is treated as `false`, and a
|
|
1482
|
+
* dev build warns once: declare `cache: false`.
|
|
1481
1483
|
*/
|
|
1482
1484
|
readonly cache?: "local" | "placed" | false;
|
|
1483
1485
|
/**
|
|
@@ -2645,7 +2647,11 @@ type Config$1 = {
|
|
|
2645
2647
|
* new sound with its id replaces it and names no `fadeMs`, or a stop names none.
|
|
2646
2648
|
*/
|
|
2647
2649
|
sfxFadeMs: number; /** Reads the player's choice from the committed player. `undefined`: the buses stay at `buses`. */
|
|
2648
|
-
volumes: Volumes | undefined;
|
|
2650
|
+
volumes: Volumes | undefined;
|
|
2651
|
+
/**
|
|
2652
|
+
* Context factory, the test seam. `undefined`: `new AudioContext()` when the global exists, otherwise headless.
|
|
2653
|
+
* On iOS the plugin calls it again after a return from the background, so each call returns a new context.
|
|
2654
|
+
*/
|
|
2649
2655
|
context: (() => AudioContextLike) | undefined; /** How many started sounds `journal()` keeps, newest last. `0` turns the journal off. */
|
|
2650
2656
|
journal: number; /** How music plays. `"stream"` needs MP3 or AAC: WebM Opus is silent through a media element in WebKit (bug 276813). Sounds always decode. */
|
|
2651
2657
|
music: MusicMode; /** Set on `navigator.audioSession.type` in `onStart`, before the context exists. No-op where the API is missing (every Chromium, Firefox). */
|
|
@@ -2740,7 +2746,9 @@ type State$1 = {
|
|
|
2740
2746
|
warnedVolumes: boolean;
|
|
2741
2747
|
music: MusicTrack | undefined; /** The latest switch still decoding; `undefined` once it started or a later request replaced it. */
|
|
2742
2748
|
musicPending: MusicSwitch | undefined; /** Removes the two window listeners of the unlock. */
|
|
2743
|
-
unlock: (() => void) | undefined; /**
|
|
2749
|
+
unlock: (() => void) | undefined; /** Cancels the renewal that waits after a return from the background: its timer and its two listeners. */
|
|
2750
|
+
renewal: (() => void) | undefined; /** The token of the renewal that runs; a stop or a newer renewal replaces it, and the old one makes nothing. */
|
|
2751
|
+
renewing: object | undefined; /** The removers of the three fx handlers. */
|
|
2744
2752
|
removers: Array<() => void>; /** The `navigator.audioSession` that took `config.session`; `stop` writes `"auto"` back to it. */
|
|
2745
2753
|
session: AudioSessionLike | undefined; /** Streamed tracks that fade out, each freed by its timer. */
|
|
2746
2754
|
retiring: Set<RetiringTrack>;
|
|
@@ -2828,8 +2836,9 @@ type AudioApi = {
|
|
|
2828
2836
|
* Tells whether the audio context runs. A shell that lets audio play with no gesture, such as a
|
|
2829
2837
|
* native webview with the requirement switched off, makes it true at start: at once when the
|
|
2830
2838
|
* context is created running, otherwise when the `resume()` of `onStart` fulfils. A browser
|
|
2831
|
-
* that wants a gesture keeps it false until the first
|
|
2832
|
-
* context
|
|
2839
|
+
* that wants a gesture keeps it false until the first touch or click on the page resumed the
|
|
2840
|
+
* context and it runs; on iOS that resume may stay pending until iOS gives the sound back. It is
|
|
2841
|
+
* false for the whole of a headless run, and for the moment an iOS renewal closes the old context.
|
|
2833
2842
|
*
|
|
2834
2843
|
* @returns True once the context is running.
|
|
2835
2844
|
* @example
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $n as Ease, Dr as TagType, Hn as Descriptor, Hr as Json, J as TransformValue, Kn as Hint, Nr as Api$5, Or as Api$2, Xn as AnchorTarget, Yn as Answered, Z as Api$3, Zn as ChangeHook, _t as ViewportSize, ci as Api, dr as AnyComponent, er as Motion, fn as Api$1, fr as AnyComponentType, gr as ComponentType, ir as ProjectionMotion, nr as MotionHandle, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, s as Events$1, t as Api$4, tr as MotionCause, ur as ViewHandle, vi as Require, vr as Entity } from "./types-
|
|
1
|
+
import { $n as Ease, Dr as TagType, Hn as Descriptor, Hr as Json, J as TransformValue, Kn as Hint, Nr as Api$5, Or as Api$2, Xn as AnchorTarget, Yn as Answered, Z as Api$3, Zn as ChangeHook, _t as ViewportSize, ci as Api, dr as AnyComponent, er as Motion, fn as Api$1, fr as AnyComponentType, gr as ComponentType, ir as ProjectionMotion, nr as MotionHandle, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, s as Events$1, t as Api$4, tr as MotionCause, ur as ViewHandle, vi as Require, vr as Entity } from "./types-qCcSw8YI.mjs";
|
|
2
2
|
import { Log } from "@moku-labs/common/browser";
|
|
3
3
|
import { PluginCtx } from "@moku-labs/core";
|
|
4
4
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -1713,11 +1713,31 @@ type TextStyleInput = {
|
|
|
1713
1713
|
* ```
|
|
1714
1714
|
*/
|
|
1715
1715
|
lineHeight?: number;
|
|
1716
|
+
/**
|
|
1717
|
+
* Evens the lines of a wrapped block, like CSS `text-wrap: balance`: a block that wraps to 2 to 6
|
|
1718
|
+
* lines is laid out at the narrowest width that keeps its number of lines, so its last line is
|
|
1719
|
+
* no lone word. `wrap` keeps the width, `balance` says how it is used; no line is wider than the
|
|
1720
|
+
* wrap. One line, no wrap, more than 6 lines or a word wider than the wrap: the greedy lines.
|
|
1721
|
+
* `measure`, the `ui` layout and the drawn label share the answer. False when left out.
|
|
1722
|
+
*
|
|
1723
|
+
* @example
|
|
1724
|
+
* ```ts
|
|
1725
|
+
* // The hint under the order board: greedy, its second line was «один.» alone.
|
|
1726
|
+
* defineTextStyles({
|
|
1727
|
+
* "shop.hint": { font: "ui.font-body", size: 32, fill: 0x3b2a1a, wrap: 800, balance: true }
|
|
1728
|
+
* });
|
|
1729
|
+
*
|
|
1730
|
+
* app.text.measure("Здесь то, что ждут ваши заказы. Возьмите один.", "shop.hint");
|
|
1731
|
+
* // { width: 441.6, height: 76.8 } on the 0.6 em fallback: «Здесь то, что ждут ваши» /
|
|
1732
|
+
* // «заказы. Возьмите один.». Without balance the width is its first line, 40 glyphs × 19.2.
|
|
1733
|
+
* ```
|
|
1734
|
+
*/
|
|
1735
|
+
balance?: boolean;
|
|
1716
1736
|
};
|
|
1717
1737
|
/**
|
|
1718
1738
|
* One style as the plugin stores it: every field filled, `bold` and `italic` only when the game
|
|
1719
1739
|
* shipped those MSDF fonts, `shadow` only when the style has one, `lineHeight` only when the style
|
|
1720
|
-
* names its line (`undefined` is the font's line).
|
|
1740
|
+
* names its line (`undefined` is the font's line), and `balance` only on a style that balances.
|
|
1721
1741
|
*
|
|
1722
1742
|
* @example
|
|
1723
1743
|
* ```ts
|
|
@@ -1742,6 +1762,7 @@ type TextStyle = {
|
|
|
1742
1762
|
digits: boolean;
|
|
1743
1763
|
shadow: TextShadow | undefined;
|
|
1744
1764
|
lineHeight: number | undefined;
|
|
1765
|
+
balance?: true;
|
|
1745
1766
|
};
|
|
1746
1767
|
/**
|
|
1747
1768
|
* What `defineTextStyles` returns and a feature registers under its `textStyles` key. Structural
|
|
@@ -2170,6 +2191,24 @@ type ScrollSnap = readonly number[] & Brand<"ScrollSnap">;
|
|
|
2170
2191
|
* ```
|
|
2171
2192
|
*/
|
|
2172
2193
|
type ScrollOffset = number & Brand<"ScrollOffset">;
|
|
2194
|
+
/**
|
|
2195
|
+
* Whether a new `offset` prop of this render stands there at once instead of gliding: in the same
|
|
2196
|
+
* solve as the content's new rects, so content that moved inside the track and an offset that moves
|
|
2197
|
+
* by as much keep what the player sees in place. A running fling or glide stops and `ScrollState`
|
|
2198
|
+
* says `moving: false`. A scroll the finger holds only remembers the prop; left out or false, a new
|
|
2199
|
+
* prop glides. A `snap` release always glides.
|
|
2200
|
+
*
|
|
2201
|
+
* @example
|
|
2202
|
+
* ```tsx
|
|
2203
|
+
* // The order strip opens on 0. A first tile of 82 u comes in at the start of the track: the
|
|
2204
|
+
* // track and the offset shift 82 in one render, and the cards stay where they were drawn.
|
|
2205
|
+
* <scroll key="strip" axis="x" offset={82} jump style={{ width: 306, height: 120 }}>
|
|
2206
|
+
* <row key="track" style={{ width: 778, height: 120 }} />
|
|
2207
|
+
* </scroll>;
|
|
2208
|
+
* // the frame of that render: ScrollState { offset: 82, max: 472, moving: false }
|
|
2209
|
+
* ```
|
|
2210
|
+
*/
|
|
2211
|
+
type ScrollJump = boolean & Brand<"ScrollJump">;
|
|
2173
2212
|
/** How many rows a windowed scroll has. */
|
|
2174
2213
|
type ScrollRows = number & Brand<"ScrollRows">;
|
|
2175
2214
|
/** The height of every row, in reference units; above 0. */
|
|
@@ -2348,13 +2387,16 @@ type ScrollWindowForm = {
|
|
|
2348
2387
|
/**
|
|
2349
2388
|
* What a scroll container takes: children for a short list, or `rows`, `rowHeight` and `row` for
|
|
2350
2389
|
* a long one, whose rows exist only in the window; the `axis` it moves on, the `snap` stops a
|
|
2351
|
-
* release glides to,
|
|
2390
|
+
* release glides to, the `offset` it stands at, and whether a new `offset` stands there at once
|
|
2391
|
+
* (`jump`).
|
|
2352
2392
|
*
|
|
2353
2393
|
* @example
|
|
2354
2394
|
* ```ts
|
|
2355
2395
|
* const props: ScrollProps = { axis: "y" };
|
|
2356
2396
|
* // The order strip: sideways, three stops, opened on the orders.
|
|
2357
2397
|
* const strip: ScrollProps = { axis: "x", snap: [0, 318, 390], offset: 318 };
|
|
2398
|
+
* // A first tile of 82 u came in at the start of the track: the strip stands on 82 at once.
|
|
2399
|
+
* const shifted: ScrollProps = { axis: "x", offset: 82, jump: true };
|
|
2358
2400
|
* // 1000 orders of 120 u in a 1600 u list: rows 0 to 18 exist at offset 0.
|
|
2359
2401
|
* const orders: ScrollProps = {
|
|
2360
2402
|
* style: { height: 1600 },
|
|
@@ -2368,6 +2410,7 @@ type ScrollProps = CommonProps & {
|
|
|
2368
2410
|
axis?: ScrollAxis;
|
|
2369
2411
|
snap?: ScrollSnap;
|
|
2370
2412
|
offset?: ScrollOffset;
|
|
2413
|
+
jump?: ScrollJump;
|
|
2371
2414
|
} & (ScrollChildForm | ScrollWindowForm);
|
|
2372
2415
|
/**
|
|
2373
2416
|
* What a text field takes. `local` is required: every keystroke writes that field of the local
|
|
@@ -8801,7 +8801,8 @@ type FilterGlobals = {
|
|
|
8801
8801
|
//#region src/plugins/renderer/kept/types.d.ts
|
|
8802
8802
|
/**
|
|
8803
8803
|
* What a slot's filter lets the cache do with it: `"local"` (kept anywhere), `"placed"` (kept with its canvas origin
|
|
8804
|
-
* through `canvasPixel`), `"screen"` (
|
|
8804
|
+
* through `canvasPixel`), `"screen"` (a body that reads the screen: its subtree picture is kept while the body runs on
|
|
8805
|
+
* its quad, on WebGPU; drawn live otherwise).
|
|
8805
8806
|
*
|
|
8806
8807
|
* @example
|
|
8807
8808
|
* ```ts
|
|
@@ -8942,8 +8943,12 @@ type KeptRecord = {
|
|
|
8942
8943
|
top: PixiContainer; /** True when the top was a render group before the cache rendered it (then it stays one at release). */
|
|
8943
8944
|
wasGroup: boolean;
|
|
8944
8945
|
mode: KeptMode; /** The slots last handed over by effects (sync/filters), the record's own copy of the reference. */
|
|
8945
|
-
slots: readonly FilterSlot[];
|
|
8946
|
-
|
|
8946
|
+
slots: readonly FilterSlot[];
|
|
8947
|
+
/**
|
|
8948
|
+
* The worst category of the slots (P4.1). A `"screen"` record is kept only on its quad, from its first take on, and
|
|
8949
|
+
* never leaves it at rest; a `"screen"` slot without a quad makes no record.
|
|
8950
|
+
*/
|
|
8951
|
+
category: FilterCache; /** Sprite(stage 1): carries the filters while kept (P3.3). */
|
|
8947
8952
|
standIn: PixiSprite | undefined; /** A second Sprite(stage 1) whose filters are [keeper] only (P3.2). */
|
|
8948
8953
|
keeperStandIn: PixiSprite | undefined; /** Sprite(stage 3), in the tree beside the top; the mesh of `shade` while the record is shaded. */
|
|
8949
8954
|
quad: KeptQuad | undefined; /** What the record draws through while shaded; made at its first entry, kept while the record lives. */
|
|
@@ -10318,7 +10323,7 @@ type ShotsInternal = {
|
|
|
10318
10323
|
forget(): void;
|
|
10319
10324
|
};
|
|
10320
10325
|
declare namespace types_d_exports$2 {
|
|
10321
|
-
export { AdaptiveScale, Api$1 as Api, AspectRange, BitmapFontData, CanvasRestart, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FilterSlotQuad, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LeaveApi, LeaveCover, LeaveLoader, LeaveLook, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorSections, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGpuProgram, PixiGraphics, PixiMatrix, PixiMesh, PixiMeshGeometry, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderTexture, PixiShader, PixiSprite, PixiTexture, PixiTextureSource, PixiUniformGroup, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, RetakeWhy, SafeArea, ShaderEventDetail, ShaderWhat, ShotPipes, ShotsApi, ShotsConfig, ShotsInternal, ShotsModule, ShotsState, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail, WhyEntry, WhyLive };
|
|
10326
|
+
export { AdaptiveScale, Api$1 as Api, AspectRange, BitmapFontData, CanvasRestart, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FilterSlotQuad, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LeaveApi, LeaveCover, LeaveLoader, LeaveLook, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorSections, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGpuProgram, PixiGraphics, PixiMatrix, PixiMesh, PixiMeshGeometry, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderLayer, PixiRenderTexture, PixiShader, PixiSprite, PixiTexture, PixiTextureSource, PixiUniformGroup, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, RetakeWhy, SafeArea, ShaderEventDetail, ShaderWhat, ShotPipes, ShotsApi, ShotsConfig, ShotsInternal, ShotsModule, ShotsState, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail, WhyEntry, WhyLive };
|
|
10322
10327
|
}
|
|
10323
10328
|
/**
|
|
10324
10329
|
* The part of Pixi the engine uses: the classes `sync` builds views from (a `Rectangle` frames the
|
|
@@ -10333,7 +10338,8 @@ declare namespace types_d_exports$2 {
|
|
|
10333
10338
|
* and the batcher pipe it subclasses, and the WGSL and GLSL shader pieces of the batch's SDF shader, and the WebGPU
|
|
10334
10339
|
* render target system with its adaptor, the pipeline system and the stencil system the lazy canvas pass of `host`
|
|
10335
10340
|
* subclasses or registers again (`host/render-pass.ts`), and the mesh and its geometry the rim-only nine-slice of
|
|
10336
|
-
* `sync` is drawn with (`sync/hollow.ts`)
|
|
10341
|
+
* `sync` is drawn with (`sync/hollow.ts`), and the render layer an overlay with `hud: "under"` draws the HUD layer in,
|
|
10342
|
+
* under its dim (`sync/overlay-look.ts`). The module object
|
|
10337
10343
|
* never arrives through a static import: `config.loadPixi()` returns it, so a game without a screen carries no
|
|
10338
10344
|
* Pixi in its bundle.
|
|
10339
10345
|
*
|
|
@@ -10349,7 +10355,7 @@ declare namespace types_d_exports$2 {
|
|
|
10349
10355
|
* pixi.defaultFilterVert.startsWith("in vec2 aPosition;"); // true
|
|
10350
10356
|
* ```
|
|
10351
10357
|
*/
|
|
10352
|
-
type PixiModule = Pick<typeof import("pixi.js"), "AlphaFilter" | "Application" | "Batcher" | "BatcherPipe" | "BitmapFont" | "BitmapText" | "BitmapTextPipe" | "BlurFilter" | "Bounds" | "Buffer" | "BufferUsage" | "Cache" | "ColorMatrixFilter" | "Container" | "DefaultBatcher" | "DisplacementFilter" | "ExtensionType" | "Filter" | "FilterSystem" | "Geometry" | "GlProgram" | "GlTextureSystem" | "GpuBatchAdaptor" | "GpuEncoderSystem" | "GpuGraphicsAdaptor" | "GpuProgram" | "GpuRenderTargetAdaptor" | "GpuRenderTargetSystem" | "GpuStencilSystem" | "GpuTextureSystem" | "Graphics" | "Matrix" | "Mesh" | "MeshGeometry" | "NineSliceSprite" | "NoiseFilter" | "Particle" | "ParticleContainer" | "PipelineSystem" | "Rectangle" | "RenderGroupPipe" | "RenderTexture" | "Shader" | "Sprite" | "Texture" | "TexturePool" | "UniformGroup" | "bitmapFontTextParser" | "bitmapFontXMLStringParser" | "colorBit" | "colorBitGl" | "compileHighShaderGlProgram" | "compileHighShaderGpuProgram" | "defaultFilterVert" | "extensions" | "generateTextureBatchBit" | "generateTextureBatchBitGl" | "getBatchSamplersUniformGroup" | "mSDFBit" | "mSDFBitGl" | "roundPixelsBit" | "roundPixelsBitGl">;
|
|
10358
|
+
type PixiModule = Pick<typeof import("pixi.js"), "AlphaFilter" | "Application" | "Batcher" | "BatcherPipe" | "BitmapFont" | "BitmapText" | "BitmapTextPipe" | "BlurFilter" | "Bounds" | "Buffer" | "BufferUsage" | "Cache" | "ColorMatrixFilter" | "Container" | "DefaultBatcher" | "DisplacementFilter" | "ExtensionType" | "Filter" | "FilterSystem" | "Geometry" | "GlProgram" | "GlTextureSystem" | "GpuBatchAdaptor" | "GpuEncoderSystem" | "GpuGraphicsAdaptor" | "GpuProgram" | "GpuRenderTargetAdaptor" | "GpuRenderTargetSystem" | "GpuStencilSystem" | "GpuTextureSystem" | "Graphics" | "Matrix" | "Mesh" | "MeshGeometry" | "NineSliceSprite" | "NoiseFilter" | "Particle" | "ParticleContainer" | "PipelineSystem" | "Rectangle" | "RenderGroupPipe" | "RenderLayer" | "RenderTexture" | "Shader" | "Sprite" | "Texture" | "TexturePool" | "UniformGroup" | "bitmapFontTextParser" | "bitmapFontXMLStringParser" | "colorBit" | "colorBitGl" | "compileHighShaderGlProgram" | "compileHighShaderGpuProgram" | "defaultFilterVert" | "extensions" | "generateTextureBatchBit" | "generateTextureBatchBitGl" | "getBatchSamplersUniformGroup" | "mSDFBit" | "mSDFBitGl" | "roundPixelsBit" | "roundPixelsBitGl">;
|
|
10353
10359
|
/**
|
|
10354
10360
|
* One Pixi application: renderer, canvas and stage.
|
|
10355
10361
|
*/
|
|
@@ -10367,6 +10373,10 @@ type PixiBounds = InstanceType<PixiModule["Bounds"]>;
|
|
|
10367
10373
|
* A Pixi sprite.
|
|
10368
10374
|
*/
|
|
10369
10375
|
type PixiSprite = InstanceType<PixiModule["Sprite"]>;
|
|
10376
|
+
/**
|
|
10377
|
+
* A Pixi render layer: it draws the containers attached to it at its own place in the tree, their parents unchanged.
|
|
10378
|
+
*/
|
|
10379
|
+
type PixiRenderLayer = InstanceType<PixiModule["RenderLayer"]>;
|
|
10370
10380
|
/**
|
|
10371
10381
|
* A Pixi nine-slice sprite.
|
|
10372
10382
|
*/
|
|
@@ -11093,13 +11103,22 @@ type SpriteOptions = {
|
|
|
11093
11103
|
* const shop: OverlayValue = {
|
|
11094
11104
|
* dim: 0.56, dimColor: 0x1b1430, cover: "none", hud: ["energy", "gems"], fade: 270, hold: true
|
|
11095
11105
|
* };
|
|
11106
|
+
* // The pyramid choice: the board and the whole HUD dim to 82 % together under it.
|
|
11107
|
+
* const pyramid: OverlayValue = {
|
|
11108
|
+
* dim: 0.82, dimColor: 0x1e161a, cover: "none", hud: "under", fade: 250, hold: false
|
|
11109
|
+
* };
|
|
11096
11110
|
* ```
|
|
11097
11111
|
*/
|
|
11098
11112
|
type OverlayValue = {
|
|
11099
11113
|
/** How dark the dim is at full level, 0 to 1; 0 draws no dim. */dim: number; /** The colour of the dim, 0xRRGGBB. */
|
|
11100
11114
|
dimColor: number; /** `"opaque"`: the overlay covers the whole screen once it has landed at alpha 1, so nothing under it is drawn. */
|
|
11101
|
-
cover: "none" | "opaque";
|
|
11102
|
-
|
|
11115
|
+
cover: "none" | "opaque";
|
|
11116
|
+
/**
|
|
11117
|
+
* The HUD parts that stay shown above the dim: every part, none, or the parts with these keys. `"under"`: the whole
|
|
11118
|
+
* HUD layer is drawn under this overlay's dim, dimmed with the rest, every part kept, and it takes no tap while it is
|
|
11119
|
+
* there; with a dim of 0 it is `"all"`.
|
|
11120
|
+
*/
|
|
11121
|
+
hud: "all" | "none" | "under" | readonly string[];
|
|
11103
11122
|
/**
|
|
11104
11123
|
* Milliseconds the dim and the HUD parts take to come and go when the root plays no enter or exit motion; a root
|
|
11105
11124
|
* with a motion is followed for its own length. 0 follows at once.
|
|
@@ -11175,8 +11194,9 @@ declare const Shape: ComponentType<ShapeValue>;
|
|
|
11175
11194
|
* Marks the view an overlay is drawn from. Everything drawn before the root of that view is kept as one picture while
|
|
11176
11195
|
* the overlay is there, and drawn again in the same frame anything in it changes; `cover: "opaque"` draws nothing
|
|
11177
11196
|
* under it while it is fully shown. The engine draws its dim and fades the HUD parts it does not keep, with the root's
|
|
11178
|
-
* own enter and exit motion (`fade` when it has none)
|
|
11179
|
-
* while it stands, so a dimmed sheet over a sharp scene
|
|
11197
|
+
* own enter and exit motion (`fade` when it has none); `hud: "under"` draws the whole HUD under the dim instead.
|
|
11198
|
+
* `hold: true` holds the endless loops of what lies under it while it stands, so a dimmed sheet over a sharp scene
|
|
11199
|
+
* draws no frame at rest.
|
|
11180
11200
|
*
|
|
11181
11201
|
* @example
|
|
11182
11202
|
* ```tsx
|
|
@@ -11184,6 +11204,8 @@ declare const Shape: ComponentType<ShapeValue>;
|
|
|
11184
11204
|
* <panel key="caseSheet" motion={sheetFade} components={[Overlay({ cover: "opaque" })]} />
|
|
11185
11205
|
* // The shop: the ward dims to 56 % and its glints rest while the shop stands; the energy and the gems stay shown.
|
|
11186
11206
|
* <stack key="shopDimLayer" components={[Overlay({ dim: 0.56, hold: true, hud: ["energy", "gems"] })]} />
|
|
11207
|
+
* // The pyramid choice: the ward and the whole HUD dim to 82 % under it, and the HUD takes no tap until it leaves.
|
|
11208
|
+
* <stack key="pyramidChoice" components={[Overlay({ dim: 0.82, dimColor: 0x1e161a, hud: "under" })]} />
|
|
11187
11209
|
* ```
|
|
11188
11210
|
*/
|
|
11189
11211
|
declare const Overlay: ComponentType<OverlayValue>;
|
|
@@ -11645,7 +11667,11 @@ type FilterSlot = {
|
|
|
11645
11667
|
filter: PixiFilter;
|
|
11646
11668
|
passes: number; /** The filter kind id, for the performance log; optional: a slot without it counts as "other". */
|
|
11647
11669
|
kind?: string; /** The stages of a filter's inputs and the seam of the kept-picture cache; filled by effects, left out by a game. */
|
|
11648
|
-
inputs?: FilterSlotInputs;
|
|
11670
|
+
inputs?: FilterSlotInputs;
|
|
11671
|
+
/**
|
|
11672
|
+
* What the kept-picture cache may do with the filter; left out, the view is drawn live. A `"screen"` slot is kept only
|
|
11673
|
+
* on its `quad`: without one the view is drawn live too.
|
|
11674
|
+
*/
|
|
11649
11675
|
cache?: FilterCache; /** The filter's `keptOrigin` uniform, which the renderer sets to the canvas origin of a picture. */
|
|
11650
11676
|
origin?: Float32Array;
|
|
11651
11677
|
/**
|
|
@@ -12742,7 +12768,12 @@ type OverlayRecord = {
|
|
|
12742
12768
|
phase: OverlayPhase; /** The phase it turned to this frame: `"shown"` at landing, `"exiting"` at the first exit frame. */
|
|
12743
12769
|
turned: OverlayPhase | undefined;
|
|
12744
12770
|
mode: OverlayMode; /** The engine's dim, made when `dim` is above 0. */
|
|
12745
|
-
dim: PixiSprite | undefined;
|
|
12771
|
+
dim: PixiSprite | undefined;
|
|
12772
|
+
/**
|
|
12773
|
+
* The render layer right under the dim that draws the HUD layer there while this overlay holds it: made once, with
|
|
12774
|
+
* the dim, for `hud: "under"`, and destroyed with the record, a restore or new layers.
|
|
12775
|
+
*/
|
|
12776
|
+
under: PixiRenderLayer | undefined; /** The dim was sized for the canvas at least once. */
|
|
12746
12777
|
sized: boolean; /** Seen by the step this frame; a record not seen is dropped. */
|
|
12747
12778
|
seen: boolean; /** The event to log once the step has decided the modes: `"open"`, `"landed"` or `"leave"`. */
|
|
12748
12779
|
news: OverlayEventDetail["what"] | undefined;
|
|
@@ -12757,7 +12788,7 @@ type ActiveRange = {
|
|
|
12757
12788
|
reason: HiddenReason | undefined; /** Bottom first: lower layer containers, then roots and engine objects of the owner's layer. */
|
|
12758
12789
|
readonly entries: PixiContainer[]; /** What the range picture hides for its render: layers above, the owner and above. */
|
|
12759
12790
|
readonly others: PixiContainer[]; /** The entries, for the membership walk. */
|
|
12760
|
-
set: Set<PixiContainer>; /** The node the picture stands before: the owner's dim, or its root. */
|
|
12791
|
+
set: Set<PixiContainer>; /** The node the picture stands before: the owner's HUD render layer, its dim, or its root. */
|
|
12761
12792
|
before: PixiContainer | undefined; /** A picture holds the range (freeze only). */
|
|
12762
12793
|
kept: boolean; /** The last take was refused; tried again when the owner or the entries change. */
|
|
12763
12794
|
refused: boolean;
|
|
@@ -12773,6 +12804,16 @@ type ActiveRange = {
|
|
|
12773
12804
|
calm: number; /** Drawn live because it changed in every frame. */
|
|
12774
12805
|
fallback: boolean;
|
|
12775
12806
|
};
|
|
12807
|
+
/**
|
|
12808
|
+
* What changed for the range since the last frame, written in place by the overlay step for the freeze rules: one
|
|
12809
|
+
* object for the life of the state, so a frame makes none. Private to the renderer.
|
|
12810
|
+
*/
|
|
12811
|
+
type RangeStep = {
|
|
12812
|
+
/** The owner is new, or changed between cover and freeze. */fresh: boolean; /** The entries differ from the last frame. */
|
|
12813
|
+
entriesChanged: boolean; /** The others differ from the last frame. */
|
|
12814
|
+
othersChanged: boolean; /** The whole-frame reasons of this decision. */
|
|
12815
|
+
wholes: ReadonlySet<DemandReason>;
|
|
12816
|
+
};
|
|
12776
12817
|
/**
|
|
12777
12818
|
* The overlay step's state, `ctx.state.sync.overlay`. Collections and arrays are reused: a frame allocates nothing.
|
|
12778
12819
|
* Private to the renderer.
|
|
@@ -12783,15 +12824,19 @@ type OverlayState = {
|
|
|
12783
12824
|
records: Map<Entity, OverlayRecord>; /** The records bottom first, reused. */
|
|
12784
12825
|
order: OverlayRecord[]; /** The range of the owner, or `undefined` with none. */
|
|
12785
12826
|
active: ActiveRange | undefined; /** The range object, made once and reused. */
|
|
12786
|
-
range: ActiveRange | undefined; /** Top objects of the HUD parts that take no tap
|
|
12787
|
-
offTops: Set<PixiContainer>; /** `
|
|
12827
|
+
range: ActiveRange | undefined; /** Top objects of the HUD parts that take no tap; a HUD layer held under a veil is skipped by the hit test through `held`. */
|
|
12828
|
+
offTops: Set<PixiContainer>; /** The HUD layer container attached to `heldBy`; `undefined` while it draws in its own place, above the overlays. */
|
|
12829
|
+
held: PixiContainer | undefined; /** The render layer of the overlay that holds the HUD under its dim (`hud: "under"`), or none. */
|
|
12830
|
+
heldBy: PixiRenderLayer | undefined; /** `"<code>:<entity>"` of the warnings logged once. */
|
|
12788
12831
|
warned: Set<string>; /** The `overlay` event lines of an agent build, until the frame hands them to the monitor. */
|
|
12789
12832
|
events: OverlayEventDetail[]; /** Scratch: the entries and others wanted this frame, and the set of the entries. */
|
|
12790
12833
|
wantEntries: PixiContainer[];
|
|
12791
12834
|
wantOthers: PixiContainer[];
|
|
12792
12835
|
wantSet: Set<PixiContainer>; /** Entities whose reason the step itself flipped this frame: their marks are no change of the range's pixels. */
|
|
12793
12836
|
flipped: Set<Entity>; /** Scratch of the tap set. */
|
|
12794
|
-
nextOff: Set<PixiContainer>; /**
|
|
12837
|
+
nextOff: Set<PixiContainer>; /** Scratch: the tops of the parts faded this frame, written in place; the tap set is built from it on a change. */
|
|
12838
|
+
offList: PixiContainer[]; /** Scratch of the freeze rules: what changed for the range this frame. */
|
|
12839
|
+
step: RangeStep; /** A view left its place in the held range since the last step (it moved, or its view went). */
|
|
12795
12840
|
left: boolean; /** Scratch of the cover test of `blurred`: made on first use from the Pixi module the renderer loaded. */
|
|
12796
12841
|
bounds: PixiBounds | undefined;
|
|
12797
12842
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Nr as Api$4, Or as Api$1, Z as Api, ni as Api$3, zr as Api$2 } from "./types-
|
|
2
|
-
import { P as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { L as InputApi } from "./types-
|
|
4
|
-
import { r as Repro } from "./headless-
|
|
5
|
-
import { i as ControlApp, o as InputOf } from "./types-
|
|
6
|
-
import { t as commands } from "./commands-
|
|
1
|
+
import { Nr as Api$4, Or as Api$1, Z as Api, ni as Api$3, zr as Api$2 } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { P as AnimApi, r as UiApi } from "./types-Cffn9Rbm.mjs";
|
|
3
|
+
import { L as InputApi } from "./types-L3E-YS4N.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-Co3SEFi5.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-BE6tcAFX.mjs";
|
|
6
|
+
import { t as commands } from "./commands-DQXSQB_C.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/visual/types.d.ts
|
|
9
9
|
/** The base commands of the `/control` door, keyed by their short names. */
|
|
@@ -296,8 +296,9 @@ const Shape = /*#__PURE__*/ component("Shape", shapeDefaults);
|
|
|
296
296
|
* Marks the view an overlay is drawn from. Everything drawn before the root of that view is kept as one picture while
|
|
297
297
|
* the overlay is there, and drawn again in the same frame anything in it changes; `cover: "opaque"` draws nothing
|
|
298
298
|
* under it while it is fully shown. The engine draws its dim and fades the HUD parts it does not keep, with the root's
|
|
299
|
-
* own enter and exit motion (`fade` when it has none)
|
|
300
|
-
* while it stands, so a dimmed sheet over a sharp scene
|
|
299
|
+
* own enter and exit motion (`fade` when it has none); `hud: "under"` draws the whole HUD under the dim instead.
|
|
300
|
+
* `hold: true` holds the endless loops of what lies under it while it stands, so a dimmed sheet over a sharp scene
|
|
301
|
+
* draws no frame at rest.
|
|
301
302
|
*
|
|
302
303
|
* @example
|
|
303
304
|
* ```tsx
|
|
@@ -305,6 +306,8 @@ const Shape = /*#__PURE__*/ component("Shape", shapeDefaults);
|
|
|
305
306
|
* <panel key="caseSheet" motion={sheetFade} components={[Overlay({ cover: "opaque" })]} />
|
|
306
307
|
* // The shop: the ward dims to 56 % and its glints rest while the shop stands; the energy and the gems stay shown.
|
|
307
308
|
* <stack key="shopDimLayer" components={[Overlay({ dim: 0.56, hold: true, hud: ["energy", "gems"] })]} />
|
|
309
|
+
* // The pyramid choice: the ward and the whole HUD dim to 82 % under it, and the HUD takes no tap until it leaves.
|
|
310
|
+
* <stack key="pyramidChoice" components={[Overlay({ dim: 0.82, dimColor: 0x1e161a, hud: "under" })]} />
|
|
308
311
|
* ```
|
|
309
312
|
*/
|
|
310
313
|
const Overlay = /*#__PURE__*/ component("Overlay", overlayDefaults);
|
|
@@ -760,19 +763,22 @@ function isLineHeight(lineHeight) {
|
|
|
760
763
|
}
|
|
761
764
|
/**
|
|
762
765
|
* Fills the defaults of one style and refuses a wrap that is not a width, `"box"` or `"none"`,
|
|
763
|
-
*
|
|
766
|
+
* a line height that is not a number above zero, and a balance that is not true or false. The
|
|
767
|
+
* stored style carries `balance` only when it balances.
|
|
764
768
|
*
|
|
765
769
|
* @param name - The style name, for the error.
|
|
766
770
|
* @param input - What the game wrote.
|
|
767
771
|
* @returns The style with every field filled.
|
|
768
772
|
* @throws {Error} When `wrap` is a number that is not greater than zero, or another word.
|
|
769
773
|
* @throws {Error} When `lineHeight` is not a finite number greater than zero.
|
|
774
|
+
* @throws {Error} When `balance` is neither left out nor a boolean.
|
|
770
775
|
*/
|
|
771
776
|
function normalizeStyle(name, input) {
|
|
772
777
|
const wrap = input.wrap ?? "none";
|
|
773
778
|
if (!isWrap(wrap)) throw new Error(`[game] Text style "${name}" has wrap ${wrap}.\n Use a width in reference px, "box" or "none".`);
|
|
774
779
|
if (!isLineHeight(input.lineHeight)) throw new Error(`[game] Text style "${name}" has lineHeight ${input.lineHeight}.\n Use a multiple of size above 0, such as 1.2.`);
|
|
775
|
-
|
|
780
|
+
if (input.balance !== void 0 && typeof input.balance !== "boolean") throw new Error(`[game] Text style "${name}" has balance ${String(input.balance)}.\n Use true or false.`);
|
|
781
|
+
const style = {
|
|
776
782
|
font: input.font,
|
|
777
783
|
bold: input.bold,
|
|
778
784
|
italic: input.italic,
|
|
@@ -787,6 +793,8 @@ function normalizeStyle(name, input) {
|
|
|
787
793
|
shadow: shadowOf(input.shadow),
|
|
788
794
|
lineHeight: input.lineHeight
|
|
789
795
|
};
|
|
796
|
+
if (input.balance === true) style.balance = true;
|
|
797
|
+
return style;
|
|
790
798
|
}
|
|
791
799
|
/**
|
|
792
800
|
* Declares the text styles of a feature. The result goes under the `textStyles` key of the
|
|
@@ -796,6 +804,7 @@ function normalizeStyle(name, input) {
|
|
|
796
804
|
* @returns The registration a feature carries.
|
|
797
805
|
* @throws {Error} When a style names a wrap that is not a width, `"box"` or `"none"`.
|
|
798
806
|
* @throws {Error} When a style names a lineHeight that is not a number above 0.
|
|
807
|
+
* @throws {Error} When a style names a balance that is not true or false.
|
|
799
808
|
* @example
|
|
800
809
|
* ```ts
|
|
801
810
|
* defineTextStyles({ "hud.digits": { font: "ui.font-digits", size: 40, fill: 0xffe082 } });
|
|
@@ -880,7 +889,8 @@ function readStyle(name, value) {
|
|
|
880
889
|
wrap: value.wrap,
|
|
881
890
|
digits: value.digits,
|
|
882
891
|
shadow: readShadow(value.shadow),
|
|
883
|
-
lineHeight: value.lineHeight
|
|
892
|
+
lineHeight: value.lineHeight,
|
|
893
|
+
balance: value.balance
|
|
884
894
|
};
|
|
885
895
|
return normalizeStyle(name, {
|
|
886
896
|
...input,
|
package/dist/visual.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-
|
|
1
|
+
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-72OVwKM4.mjs";
|
|
2
2
|
export { type CheckpointResult, type VisualApp, type VisualOptions, type VisualPage, type VisualRenderer, type VisualReport, type VisualSetup, type VisualStart, type VisualStep, type VisualTest, type VisualTestResult, type VisualTolerance, defineVisualTest, parseVisualArgv, runVisualTests };
|
package/dist/visual.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as VISUAL_CLOCK } from "./fake-hnJcJeYf.mjs";
|
|
2
|
-
import { n as read, t as sources } from "./sources-
|
|
2
|
+
import { n as read, t as sources } from "./sources-Cqqz-0-b.mjs";
|
|
3
3
|
import { n as commands, t as run } from "./run-B5if0jxE.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createBrandConsole } from "@moku-labs/common/cli";
|