@moku-labs/game 0.15.156 → 0.15.158
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/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-C2tSoUFu.d.mts → commands-CLhKYlot.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-DN43b9Hv.d.mts → define-3zxu6rIq.d.mts} +2 -2
- package/dist/{headless-CW6AZ8_F.d.mts → headless-DFkrIVO4.d.mts} +1 -1
- package/dist/{index-DRAcyKrv.d.mts → index-CVmEBBm5.d.mts} +26 -5
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/inspect.d.mts +6 -6
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-Dk1G1aCO.d.mts → runtime-CI8p6sVn.d.mts} +1 -1
- package/dist/{src-BGbnqnFj.mjs → src-BCuqGRF9.mjs} +1379 -160
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-8wz-Eq_I.d.mts → types-Bl9jyah_.d.mts} +2 -2
- package/dist/{types-CXppid1m.d.mts → types-CM7Ng3EN.d.mts} +2 -2
- package/dist/{types-CgLUzbF_.d.mts → types-D-vnlN3n.d.mts} +2 -2
- package/dist/{types-BrW_M5xD.d.mts → types-D1xdKk_t.d.mts} +294 -22
- package/dist/{types-7zYmozvP.d.mts → types-DHWjH6p9.d.mts} +4 -4
- package/dist/{visual-Xic-LNjH.d.mts → visual-D_4mmn1u.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/llms.txt +1 -0
- package/package.json +1 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Bn as NodeTable, Ir as ClockSource, Jn as Hint, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Wn as Descriptor, Wr as Json, Yn 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 { Bn as NodeTable, Ir as ClockSource, Jn as Hint, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Wn as Descriptor, Wr as Json, Yn as NodeFx } from "./types-D1xdKk_t.mjs";
|
|
2
|
+
import { t as createApp } from "./index-CVmEBBm5.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-DHWjH6p9.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-DFkrIVO4.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 { gn as refuseStart, k as flattenFeatures, t as createApp, vn as exit, xn as type } from "./src-
|
|
1
|
+
import { gn as refuseStart, k as flattenFeatures, t as createApp, vn as exit, xn as type } from "./src-BCuqGRF9.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-DeD9wis6.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-yi2XmYWC.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $n as ChangeHook, Ar as Api$2, D as AxisPose, Fr as Api$5, Jn as Hint, Q as Api$3, Qn as AnchorTarget, Wn as Descriptor, Wr as Json, Y as TransformValue, Zn as Answered, ar as NumericFields, bi as Require, br as Entity, cr as ReducedMotion, fr as ViewHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, kr as TagType, mn as Api$1, mr as AnyComponentType, nr as Motion, or as ProjectionMotion, pr as AnyComponent, rr as MotionCause, s as Events$1, t as Api$4, tr as Ease, tt as PixiContainer, ui as Api, vr as ComponentType, yt as ViewportSize } from "./types-
|
|
1
|
+
import { $n as ChangeHook, Ar as Api$2, D as AxisPose, Fr as Api$5, Jn as Hint, Q as Api$3, Qn as AnchorTarget, Wn as Descriptor, Wr as Json, Y as TransformValue, Zn as Answered, ar as NumericFields, bi as Require, br as Entity, cr as ReducedMotion, fr as ViewHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, kr as TagType, mn as Api$1, mr as AnyComponentType, nr as Motion, or as ProjectionMotion, pr as AnyComponent, rr as MotionCause, s as Events$1, t as Api$4, tr as Ease, tt as PixiContainer, ui as Api, vr as ComponentType, yt as ViewportSize } from "./types-D1xdKk_t.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";
|
|
@@ -2160,7 +2160,7 @@ type TextApi = {
|
|
|
2160
2160
|
* is the same in a browser and in plain Bun. A block with pieces of other looks (`<span>`,
|
|
2161
2161
|
* `boldStyle`) is as high as the line boxes of its lines, and the width counts `textIndent`.
|
|
2162
2162
|
* Cached per style and resolved string, and per width for a `"box"` style. A call with a width is a layout's (`ui.layout` is the caller it is
|
|
2163
|
-
* meant for): it marks the style as laid out, so a label of it with no box (one that fits its
|
|
2163
|
+
* meant for, and `ui.lint` measures at the laid-out width too): it marks the style as laid out, so a label of it with no box (one that fits its
|
|
2164
2164
|
* row) no longer warns `wrap "box" outside layout` (F65).
|
|
2165
2165
|
*
|
|
2166
2166
|
* @param content - A plain string, or what `tr` returned.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $r as Snapshot, Wr as Json } from "./types-
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { $r as Snapshot, Wr as Json } from "./types-D1xdKk_t.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-DFkrIVO4.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as FilterSlotInputs, Ar as Api$3, M as SyncApi, Q as Api$4, Qn as AnchorTarget, Un as TypeTag, Ur as Events$3, Vr as Api$6, Wn as Descriptor, Wr as Json, ar as NumericFields, at as PixiSprite, b as Events$4, bi as Require, br as Entity, bt as FilterCache, cr as ReducedMotion, dr as TrackSegment, gr as ComponentHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, j as FilterSlotQuad, k as FilterSlot, mn as Api$2, nt as PixiFilter, oi as Events$5, ot as PixiTexture, pr as AnyComponent, rt as PixiGpuProgram, s as Events$1, st as PixiUniformGroup, t as Api$5, tr as Ease, ui as Api$1, ur as TrackOptions, vr as ComponentType, vt as Point, yi as Events$2 } from "./types-
|
|
2
|
-
import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-
|
|
1
|
+
import { A as FilterSlotInputs, Ar as Api$3, M as SyncApi, Q as Api$4, Qn as AnchorTarget, Un as TypeTag, Ur as Events$3, Vr as Api$6, Wn as Descriptor, Wr as Json, ar as NumericFields, at as PixiSprite, b as Events$4, bi as Require, br as Entity, bt as FilterCache, cr as ReducedMotion, dr as TrackSegment, gr as ComponentHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, j as FilterSlotQuad, k as FilterSlot, mn as Api$2, nt as PixiFilter, oi as Events$5, ot as PixiTexture, pr as AnyComponent, rt as PixiGpuProgram, s as Events$1, st as PixiUniformGroup, t as Api$5, tr as Ease, ui as Api$1, ur as TrackOptions, vr as ComponentType, vt as Point, yi as Events$2 } from "./types-D1xdKk_t.mjs";
|
|
2
|
+
import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-Bl9jyah_.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -9067,6 +9067,11 @@ type FilterGlobals = {
|
|
|
9067
9067
|
uGlobalFrame: Float32Array;
|
|
9068
9068
|
uOutputTexture: Float32Array;
|
|
9069
9069
|
};
|
|
9070
|
+
/** The group of the global filter uniforms, and its vectors: the arrays the group itself reads. */
|
|
9071
|
+
type FilterGlobalsHandle = {
|
|
9072
|
+
readonly group: PixiUniformGroup;
|
|
9073
|
+
readonly vectors: FilterGlobals;
|
|
9074
|
+
};
|
|
9070
9075
|
//#endregion
|
|
9071
9076
|
//#region src/plugins/renderer/kept/types.d.ts
|
|
9072
9077
|
/**
|
|
@@ -10639,7 +10644,7 @@ type TrailState = {
|
|
|
10639
10644
|
stop: (() => void) | undefined;
|
|
10640
10645
|
};
|
|
10641
10646
|
declare namespace types_d_exports$2 {
|
|
10642
|
-
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 };
|
|
10647
|
+
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, LeaveTransition, 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, TransitionBodyKind, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail, WhyEntry, WhyLive };
|
|
10643
10648
|
}
|
|
10644
10649
|
/**
|
|
10645
10650
|
* The part of Pixi the engine uses: the classes `sync` builds views from (a `Rectangle` frames the
|
|
@@ -12500,24 +12505,84 @@ type LeaveLoader = {
|
|
|
12500
12505
|
*/
|
|
12501
12506
|
due?: () => string | undefined;
|
|
12502
12507
|
};
|
|
12508
|
+
/** The fields every transition of a scene switch carries, resolved: its length, its curve and its reduced-motion rule. */
|
|
12509
|
+
type LeaveTransitionCommon = {
|
|
12510
|
+
/** Clock milliseconds the picture takes to go, more than 0. */ms: number; /** The curve of its progress: a name `applyEase` knows, or a function of the time 0..1. */
|
|
12511
|
+
ease: Ease; /** With reduced motion on: `"cut"` swaps at once with no transition, `"keep"` plays it as written. */
|
|
12512
|
+
reduced: "cut" | "keep";
|
|
12513
|
+
};
|
|
12503
12514
|
/**
|
|
12504
|
-
*
|
|
12515
|
+
* The transition of a scene switch (spec 36), every field resolved by `scenes`: the picture of the last frame of the
|
|
12516
|
+
* scene being left, drawn over the next scene from the swap for `ms`, then gone. `fade` lowers its alpha to 0, `slide`
|
|
12517
|
+
* moves it off the canvas towards `to`, `wipe` hides it behind a line at `angle` (radians, edge `soft`), `iris` closes it
|
|
12518
|
+
* into the point `x`, `y` (0..1 of the canvas, edge `soft`), `dissolve` eats it away by a noise of `scale` cells with a
|
|
12519
|
+
* rim of `edge` in `edgeColor`. `wipe`, `iris` and `dissolve` draw on the bodies of `RevealLine`, `RevealRound` and
|
|
12520
|
+
* `Dissolve`, and play as `fade` when that member is listed in no feature's `filters`.
|
|
12521
|
+
*
|
|
12522
|
+
* @example
|
|
12523
|
+
* ```ts
|
|
12524
|
+
* // A board left with `leave: { transition: { kind: "wipe", angle: Math.PI } }`: the defaults filled in.
|
|
12525
|
+
* const wipe: LeaveTransition = { kind: "wipe", ms: 400, ease: "inOut", reduced: "cut", angle: Math.PI, soft: 0.04 };
|
|
12526
|
+
* const fade: LeaveTransition = { kind: "fade", ms: 400, ease: "inOut", reduced: "cut" };
|
|
12527
|
+
* ```
|
|
12528
|
+
*/
|
|
12529
|
+
type LeaveTransition = LeaveTransitionCommon & ({
|
|
12530
|
+
kind: "fade";
|
|
12531
|
+
} | {
|
|
12532
|
+
kind: "slide";
|
|
12533
|
+
to: "left" | "right" | "up" | "down";
|
|
12534
|
+
} | {
|
|
12535
|
+
kind: "wipe";
|
|
12536
|
+
angle: number;
|
|
12537
|
+
soft: number;
|
|
12538
|
+
} | {
|
|
12539
|
+
kind: "iris";
|
|
12540
|
+
x: number;
|
|
12541
|
+
y: number;
|
|
12542
|
+
soft: number;
|
|
12543
|
+
} | {
|
|
12544
|
+
kind: "dissolve";
|
|
12545
|
+
scale: number;
|
|
12546
|
+
edge: number;
|
|
12547
|
+
edgeColor: number;
|
|
12548
|
+
});
|
|
12549
|
+
/**
|
|
12550
|
+
* The kinds of transition drawn on the body of a set member that `effects` hands over (`sync.leave.body`).
|
|
12551
|
+
*
|
|
12552
|
+
* @example
|
|
12553
|
+
* ```ts
|
|
12554
|
+
* const kind: TransitionBodyKind = "iris"; // drawn on the body of `RevealRound`
|
|
12555
|
+
* ```
|
|
12556
|
+
*/
|
|
12557
|
+
type TransitionBodyKind = "wipe" | "iris" | "dissolve";
|
|
12558
|
+
/**
|
|
12559
|
+
* What a scene switch shows over the scene being left: the veil, the loader, or both, and the transition from its last
|
|
12560
|
+
* frame to the next scene. A part left out is not drawn.
|
|
12505
12561
|
*
|
|
12506
12562
|
* @example
|
|
12507
12563
|
* ```ts
|
|
12508
12564
|
* // The default of `scenes`: the veil from the start, the engine's ring once the switch took 400 ms.
|
|
12509
12565
|
* const look: LeaveLook = { cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } };
|
|
12566
|
+
* // A scene left with a fade and neither veil nor loader: the look is the transition alone.
|
|
12567
|
+
* const faded: LeaveLook = { transition: { kind: "fade", ms: 400, ease: "inOut", reduced: "cut" } };
|
|
12510
12568
|
* ```
|
|
12511
12569
|
*/
|
|
12512
12570
|
type LeaveLook = {
|
|
12513
12571
|
/** The veil; absent for none. */cover?: LeaveCover; /** The loader; absent for none. */
|
|
12514
12572
|
loader?: LeaveLoader;
|
|
12573
|
+
/**
|
|
12574
|
+
* The transition, resolved; absent for none. The swap waits for `capture()`, which copies the last drawn frame, veil
|
|
12575
|
+
* and loader included, and `play()` draws that picture over the next scene. With reduced motion on, a transition with
|
|
12576
|
+
* `reduced: "cut"` is dropped at `show`.
|
|
12577
|
+
*/
|
|
12578
|
+
transition?: LeaveTransition;
|
|
12515
12579
|
};
|
|
12516
12580
|
/**
|
|
12517
12581
|
* The picture of a scene being left, `app.renderer.sync.leave` (spec 33, slice A2): a veil over the whole canvas and a
|
|
12518
12582
|
* loader at its centre, drawn in a container of the engine above the root and every layer. `scenes` drives it: it
|
|
12519
|
-
* shows it at the start of a live switch, lands it at the swap and drops it on an abort.
|
|
12520
|
-
*
|
|
12583
|
+
* shows it at the start of a live switch, lands it at the swap and drops it on an abort. A look with a transition (spec
|
|
12584
|
+
* 36) holds the swap on `capture` until the last frame is copied, and `play` draws that picture over the next scene.
|
|
12585
|
+
* It takes no hit: the hit test walks the layers of the scene only.
|
|
12521
12586
|
*
|
|
12522
12587
|
* @example
|
|
12523
12588
|
* ```ts
|
|
@@ -12533,7 +12598,7 @@ type LeaveApi = {
|
|
|
12533
12598
|
* the last swap), the loader waits for its `afterMs`. A look shown while another runs replaces it. Asks for a frame.
|
|
12534
12599
|
* Inert, nothing is drawn and nothing is kept.
|
|
12535
12600
|
*
|
|
12536
|
-
* @param look - The veil and the
|
|
12601
|
+
* @param look - The veil, the loader and the transition, resolved.
|
|
12537
12602
|
* @example
|
|
12538
12603
|
* ```ts
|
|
12539
12604
|
* // `scenes` leaves a scene whose `leave` names a turning texture: the veil from the next frame, the texture at 400 ms.
|
|
@@ -12567,12 +12632,87 @@ type LeaveApi = {
|
|
|
12567
12632
|
* ```
|
|
12568
12633
|
*/
|
|
12569
12634
|
drop(): void;
|
|
12635
|
+
/**
|
|
12636
|
+
* Asks for the picture of the transition the running look carries: the canvas as the next drawn frame stands, veil and
|
|
12637
|
+
* loader included, copied on the GPU with no render pass. `"wait"` until that frame was drawn (the first call asks for
|
|
12638
|
+
* it), `"ready"` once the picture holds it, `"none"` when no picture can be taken: no transition, reduced motion cut
|
|
12639
|
+
* it, the swap came, WebGL, no device.
|
|
12640
|
+
*
|
|
12641
|
+
* @returns Whether the swap may commit with the transition now.
|
|
12642
|
+
* @example
|
|
12643
|
+
* ```ts
|
|
12644
|
+
* // `scenes`, the board built and its look carrying a wipe: the swap waits one frame for the picture of the ward.
|
|
12645
|
+
* const leave = ctx.require(rendererPlugin).sync.leave;
|
|
12646
|
+
* leave.capture(); // "wait": the next drawn frame is copied
|
|
12647
|
+
* leave.capture(); // "ready", one frame later; "none" on a WebGL device, and the swap commits as before
|
|
12648
|
+
* ```
|
|
12649
|
+
*/
|
|
12650
|
+
capture(): "wait" | "ready" | "none";
|
|
12651
|
+
/**
|
|
12652
|
+
* Starts the transition whose picture `capture()` answered `"ready"` for: the picture is drawn over the next scene
|
|
12653
|
+
* from this frame, and goes over the transition's `ms` on the clock. The veil and a ring or texture loader leave at
|
|
12654
|
+
* once (they are in the picture); a layer loader waits unseen for its views to leave. `land()` after it changes
|
|
12655
|
+
* nothing of the transition. No picture taken: nothing happens.
|
|
12656
|
+
*
|
|
12657
|
+
* @example
|
|
12658
|
+
* ```ts
|
|
12659
|
+
* // `scenes`, in the signals phase the capture answered "ready", right after `swapIn`: the swap frame draws the board
|
|
12660
|
+
* // under the picture of the ward, which fades out over 400 ms.
|
|
12661
|
+
* ctx.require(rendererPlugin).sync.leave.play();
|
|
12662
|
+
* ```
|
|
12663
|
+
*/
|
|
12664
|
+
play(): void;
|
|
12665
|
+
/**
|
|
12666
|
+
* Hands the renderer the body of a set member to draw a transition of its kind on: `wipe` on `RevealLine`, `iris` on
|
|
12667
|
+
* `RevealRound`, `dissolve` on `Dissolve`. A kind with no body plays as `fade`, and a dev or agent build warns once
|
|
12668
|
+
* (`renderer:transition-body-missing`). A body handed again for a kind replaces the one before.
|
|
12669
|
+
*
|
|
12670
|
+
* @param kind - The transition kind the body draws.
|
|
12671
|
+
* @param quad - The member's body on its quad, as on its filter slot.
|
|
12672
|
+
* @param member - The member's export name, for the logs.
|
|
12673
|
+
* @returns What takes the body back; a transition playing on it ends at once, its picture freed and its shader
|
|
12674
|
+
* destroyed, and a later transition of the kind plays as `fade`.
|
|
12675
|
+
* @example
|
|
12676
|
+
* ```ts
|
|
12677
|
+
* // `effects` at start, for a `RevealLine` listed in a feature's `filters`, its warm filter's quad in hand.
|
|
12678
|
+
* const takeBack = ctx.require(rendererPlugin).sync.leave.body("wipe", revealLineQuad, "RevealLine");
|
|
12679
|
+
* takeBack(); // at stop: a wipe after it plays as a fade
|
|
12680
|
+
* ```
|
|
12681
|
+
*/
|
|
12682
|
+
body(kind: TransitionBodyKind, quad: FilterSlotQuad, member: string): () => void;
|
|
12683
|
+
/**
|
|
12684
|
+
* Tells the renderer whether the player asked for reduced motion: a look shown while it is on drops a transition whose
|
|
12685
|
+
* `reduced` is `"cut"`, and its `capture()` answers `"none"`. A transition with `reduced: "keep"` plays as written.
|
|
12686
|
+
*
|
|
12687
|
+
* @param on - True while reduced motion is on.
|
|
12688
|
+
* @example
|
|
12689
|
+
* ```ts
|
|
12690
|
+
* // `anim`, at start and when the player turns reduced motion on in the settings.
|
|
12691
|
+
* ctx.require(rendererPlugin).sync.leave.setReducedMotion(true);
|
|
12692
|
+
* ```
|
|
12693
|
+
*/
|
|
12694
|
+
setReducedMotion(on: boolean): void;
|
|
12695
|
+
};
|
|
12696
|
+
/**
|
|
12697
|
+
* The engine's objects of a transition's picture, made at the first transition that needs each and kept for the
|
|
12698
|
+
* application's life: the sprite of a `fade` or a `slide`; the mesh on the unit quad, its geometry and its global filter
|
|
12699
|
+
* uniforms for the kinds drawn on a set body, with one shader per kind, bound to the picture of each run. Not public.
|
|
12700
|
+
*/
|
|
12701
|
+
type PictureObjects = {
|
|
12702
|
+
sprite?: PixiSprite;
|
|
12703
|
+
mesh?: PixiMesh;
|
|
12704
|
+
geometry?: PixiMeshGeometry;
|
|
12705
|
+
globals?: FilterGlobalsHandle; /** One shader per body kind, made for the body handed then: a new body builds it again. */
|
|
12706
|
+
shaders: Map<TransitionBodyKind, {
|
|
12707
|
+
quad: FilterSlotQuad;
|
|
12708
|
+
shader: PixiShader;
|
|
12709
|
+
}>;
|
|
12570
12710
|
};
|
|
12571
12711
|
/**
|
|
12572
12712
|
* The engine's objects of the picture of a scene being left, made once per application at the first step that needs
|
|
12573
12713
|
* them and kept: `top` hangs on the stage above the root while a look runs; `veil` (the white texture, tinted) covers
|
|
12574
12714
|
* the canvas; `frame` carries the root's transform, so `ring`, `spinner` and `held` (where a lifted layer hangs) are in
|
|
12575
|
-
* reference units. Not public.
|
|
12715
|
+
* reference units; `picture`, what a transition's picture is drawn with. Not public.
|
|
12576
12716
|
*/
|
|
12577
12717
|
type LeaveObjects = {
|
|
12578
12718
|
top: PixiContainer;
|
|
@@ -12581,6 +12721,28 @@ type LeaveObjects = {
|
|
|
12581
12721
|
ring: PixiGraphics;
|
|
12582
12722
|
spinner: PixiSprite;
|
|
12583
12723
|
held: PixiContainer;
|
|
12724
|
+
picture: PictureObjects;
|
|
12725
|
+
};
|
|
12726
|
+
/**
|
|
12727
|
+
* The transition of a switch (spec 36): asked for by `capture`, its picture taken by the next drawn frame, then playing
|
|
12728
|
+
* from `play` at `playStartedAt` on the clock, drawn as `drawn` (the transition's kind, or `"fade"` for a kind with no
|
|
12729
|
+
* body) on `quad`, the body held at `play`. Beside the look run, so the take-down of the look never drops it. Not
|
|
12730
|
+
* public.
|
|
12731
|
+
*/
|
|
12732
|
+
type TransitionRun = {
|
|
12733
|
+
transition: LeaveTransition; /** The copy of the canvas; absent until the frame that takes it. */
|
|
12734
|
+
picture: PixiRenderTexture | undefined;
|
|
12735
|
+
playStartedAt: number;
|
|
12736
|
+
capture: "asked" | "taken" | "playing";
|
|
12737
|
+
drawn: LeaveTransition["kind"]; /** The body a `wipe`, an `iris` or a `dissolve` draws on, taken at `play`; absent for a sprite. */
|
|
12738
|
+
quad: FilterSlotQuad | undefined; /** The `edgeColor` written into a dissolve body's colour uniform in this run; -1 before. */
|
|
12739
|
+
edgeColor: number;
|
|
12740
|
+
/**
|
|
12741
|
+
* The transition's numbers a frame reads, copied at `play` into 64-bit floats of this run's own (`ms`, a wipe's
|
|
12742
|
+
* `angle`, an iris's `x`, `y` and the radius that shows the whole canvas, ...). A frame reads these, never the
|
|
12743
|
+
* transition object's fields, whose form V8 keeps by the history of their shape. Laid out by `sync/transition.ts`.
|
|
12744
|
+
*/
|
|
12745
|
+
numbers: Float64Array;
|
|
12584
12746
|
};
|
|
12585
12747
|
/** What the loader of a running look draws once it is due. Not public. */
|
|
12586
12748
|
type LoaderKind = "none" | "ring" | "texture" | "layer";
|
|
@@ -12602,6 +12764,11 @@ type LeaveRun = {
|
|
|
12602
12764
|
layer?: string; /** The layer container a `"layer"` loader drew above the veil, kept through the fade-out; absent while none is. */
|
|
12603
12765
|
lifted?: PixiContainer; /** The loader is shown: past its `afterMs`, before the swap; after it, a layer loader that showed, while it fades. */
|
|
12604
12766
|
shown: boolean;
|
|
12767
|
+
/**
|
|
12768
|
+
* The look's transition while it may still play: absent without one, when reduced motion cut it at `show`, and once
|
|
12769
|
+
* no picture could be taken.
|
|
12770
|
+
*/
|
|
12771
|
+
transition: LeaveTransition | undefined;
|
|
12605
12772
|
};
|
|
12606
12773
|
/**
|
|
12607
12774
|
* A loader layer that faded out with the veil and waits above it, at alpha 0, until the loader's views left it: under
|
|
@@ -12619,12 +12786,18 @@ type LeaveParked = {
|
|
|
12619
12786
|
/**
|
|
12620
12787
|
* The picture of a scene being left (spec 33, slice A2): the running look, absent while none runs; the engine's
|
|
12621
12788
|
* objects, absent until the first look needs them and after the application that held them was lost; and the loader
|
|
12622
|
-
* layer that waits for its views to leave, absent while none does.
|
|
12789
|
+
* layer that waits for its views to leave, absent while none does. Its transition (spec 36): the one asked for or
|
|
12790
|
+
* playing, the set bodies `effects` handed by kind, whether reduced motion is on, and the kinds warned of once for a
|
|
12791
|
+
* missing body. Not public.
|
|
12623
12792
|
*/
|
|
12624
12793
|
type LeaveState = {
|
|
12625
12794
|
run?: LeaveRun;
|
|
12626
12795
|
objects?: LeaveObjects;
|
|
12627
12796
|
parked?: LeaveParked;
|
|
12797
|
+
playing?: TransitionRun;
|
|
12798
|
+
bodies: Map<TransitionBodyKind, FilterSlotQuad>;
|
|
12799
|
+
reduced: boolean;
|
|
12800
|
+
warnedKinds: Set<TransitionBodyKind>;
|
|
12628
12801
|
};
|
|
12629
12802
|
/**
|
|
12630
12803
|
* sync module API, `app.renderer.sync`. The one owner of every display object: it builds them
|
|
@@ -12761,7 +12934,8 @@ type SyncApi = {
|
|
|
12761
12934
|
*/
|
|
12762
12935
|
filters: FiltersApi;
|
|
12763
12936
|
/**
|
|
12764
|
-
* The picture of a scene being left: the veil and the loader `scenes` shows during a live switch
|
|
12937
|
+
* The picture of a scene being left: the veil and the loader `scenes` shows during a live switch, and the transition
|
|
12938
|
+
* picture it plays over the next scene.
|
|
12765
12939
|
*
|
|
12766
12940
|
* @example
|
|
12767
12941
|
* ```ts
|
|
@@ -12885,6 +13059,13 @@ type SyncInternal = {
|
|
|
12885
13059
|
* callback before the decision. One field read and no allocation while no look runs.
|
|
12886
13060
|
*/
|
|
12887
13061
|
stepLeave(): void;
|
|
13062
|
+
/**
|
|
13063
|
+
* The picture of a transition, right after the stage render (spec 36): when one is asked for and the frame was drawn,
|
|
13064
|
+
* the canvas texture is copied into it, one copy and one submit, no render pass. One field read while none is asked.
|
|
13065
|
+
*
|
|
13066
|
+
* @param drawn - Whether Pixi drew the frame (never the heat map).
|
|
13067
|
+
*/
|
|
13068
|
+
leaveAfter(drawn: boolean): void;
|
|
12888
13069
|
/**
|
|
12889
13070
|
* Hands Pixi again the filters of every view whose filters were switched on or off since they were written: Pixi
|
|
12890
13071
|
* holds only the enabled ones (E3). Run by the draw callback before anything reads the tree, so a switch is drawn in
|
|
@@ -13457,7 +13638,7 @@ type PassCount = {
|
|
|
13457
13638
|
enabled: boolean[];
|
|
13458
13639
|
};
|
|
13459
13640
|
declare namespace types_d_exports$1 {
|
|
13460
|
-
export { AnySceneProjection, BundleProgress, BundleShare, CheckedProjections, Config$1 as Config, DefineScene, Deps$1 as Deps, Events$1 as Events, FadingLoader, FullCover, FullLeave, FullLoader, HeldLoader, KernelSlice$1 as KernelSlice, LayerMap, LeaveSwitch, Leaving, LoaderFeed, NamedMemo, RunContext, SceneBuild, SceneCover, SceneDefinition, SceneEnter, SceneLayer, SceneLeave, SceneLoader, SceneOwner, SceneProjection, SceneSpec, SceneState, ScenesApi, ScenesCtx, SortRule, State$1 as State, UiLayer };
|
|
13641
|
+
export { AnySceneProjection, BundleProgress, BundleShare, CheckedProjections, Config$1 as Config, DefineScene, Deps$1 as Deps, Events$1 as Events, FadingLoader, FullCover, FullLeave, FullLoader, HeldLoader, KernelSlice$1 as KernelSlice, LayerMap, LeaveSwitch, Leaving, LoaderFeed, NamedMemo, RunContext, SceneBuild, SceneCover, SceneDefinition, SceneEnter, SceneLayer, SceneLeave, SceneLoader, SceneOwner, SceneProjection, SceneSpec, SceneState, SceneTransition, ScenesApi, ScenesCtx, SortRule, State$1 as State, UiLayer };
|
|
13461
13642
|
}
|
|
13462
13643
|
/**
|
|
13463
13644
|
* How a layer orders what is drawn in it. The scene's name for the rule `world` stores.
|
|
@@ -13611,13 +13792,70 @@ type SceneLoader<Asset extends string = string> = {
|
|
|
13611
13792
|
*/
|
|
13612
13793
|
projection?: string;
|
|
13613
13794
|
};
|
|
13795
|
+
/** The fields every transition of a scene switch may carry. */
|
|
13796
|
+
type SceneTransitionCommon = {
|
|
13797
|
+
/** Milliseconds the picture takes to go, above 0 and at most 5000. Default 400. */ms?: number; /** The curve of its progress: a name (`"linear"`, `"in"`, `"out"`, `"inOut"`, ...) or a function of the time 0..1. Default `"inOut"`. */
|
|
13798
|
+
ease?: Ease;
|
|
13799
|
+
/**
|
|
13800
|
+
* With reduced motion on: `"cut"` swaps at once with no transition, `"keep"` plays it as written. Default `"cut"`.
|
|
13801
|
+
*/
|
|
13802
|
+
reduced?: "cut" | "keep";
|
|
13803
|
+
};
|
|
13614
13804
|
/**
|
|
13615
|
-
*
|
|
13616
|
-
* `
|
|
13617
|
-
*
|
|
13618
|
-
*
|
|
13619
|
-
*
|
|
13620
|
-
*
|
|
13805
|
+
* A transition from a picture of the last frame of the scene being left, drawn over the next scene from the swap for
|
|
13806
|
+
* `ms`, then gone (spec 36). One of five kinds, each with the fields it takes; a field the kind does not take is an
|
|
13807
|
+
* error. The picture holds what stood on the screen, the veil and the loader included, and takes no tap: the next scene
|
|
13808
|
+
* takes taps from the swap. Fast mode, a headless app, the first scene of a run and a device with no WebGPU play none.
|
|
13809
|
+
*
|
|
13810
|
+
* | kind | what it does | fields (default) |
|
|
13811
|
+
* |---|---|---|
|
|
13812
|
+
* | `fade` | the picture fades out | none |
|
|
13813
|
+
* | `slide` | the picture slides off the screen | `to` (`"left"`) |
|
|
13814
|
+
* | `wipe` | an edge sweeps the picture away | `angle` (0, radians; 0 sweeps from left to right), `soft` (0.04) |
|
|
13815
|
+
* | `iris` | the picture closes into a point | `x`, `y` (0.5, shares of the screen), `soft` (0.05) |
|
|
13816
|
+
* | `dissolve` | noise eats the picture away | `scale` (8 cells), `edge` (0.08), `edgeColor` (`0xffffff`) |
|
|
13817
|
+
*
|
|
13818
|
+
* `wipe`, `iris` and `dissolve` draw on the bodies of `RevealLine`, `RevealRound` and `Dissolve` of the effects set:
|
|
13819
|
+
* list them in the `filters` of a feature, or the transition plays as a `fade` (a dev build says which member to list).
|
|
13820
|
+
*
|
|
13821
|
+
* @example
|
|
13822
|
+
* ```ts
|
|
13823
|
+
* // The board leaves with a wipe from right to left; every way into the night is an iris of 500 ms; a memory
|
|
13824
|
+
* // dissolves into the ward with a golden rim.
|
|
13825
|
+
* const wipe: SceneTransition = { kind: "wipe", angle: Math.PI };
|
|
13826
|
+
* const iris: SceneTransition = { kind: "iris", ms: 500 };
|
|
13827
|
+
* const dissolve: SceneTransition = { kind: "dissolve", edgeColor: 0xffd27a };
|
|
13828
|
+
* ```
|
|
13829
|
+
*/
|
|
13830
|
+
type SceneTransition = SceneTransitionCommon & ({
|
|
13831
|
+
kind: "fade";
|
|
13832
|
+
} | {
|
|
13833
|
+
kind: "slide"; /** The edge of the screen the picture slides off to. Default `"left"`. */
|
|
13834
|
+
to?: "left" | "right" | "up" | "down";
|
|
13835
|
+
} | {
|
|
13836
|
+
kind: "wipe"; /** The direction the edge moves in, radians; 0 sweeps from left to right. Default 0. */
|
|
13837
|
+
angle?: number; /** The softness of the edge, a share of the screen from 0 to 1. Default 0.04. */
|
|
13838
|
+
soft?: number;
|
|
13839
|
+
} | {
|
|
13840
|
+
kind: "iris"; /** The point the picture closes into, a share of the screen width from 0 to 1. Default 0.5. */
|
|
13841
|
+
x?: number; /** The point the picture closes into, a share of the screen height from 0 to 1. Default 0.5. */
|
|
13842
|
+
y?: number; /** The softness of the edge, a share of the screen from 0 to 1. Default 0.05. */
|
|
13843
|
+
soft?: number;
|
|
13844
|
+
} | {
|
|
13845
|
+
kind: "dissolve"; /** The cells of the noise across the screen, above 0. Default 8. */
|
|
13846
|
+
scale?: number; /** The width of the rim where the picture burns away, from 0 to 1. Default 0.08. */
|
|
13847
|
+
edge?: number; /** The colour of the rim, `0xRRGGBB`. Default `0xffffff`. */
|
|
13848
|
+
edgeColor?: number;
|
|
13849
|
+
});
|
|
13850
|
+
/**
|
|
13851
|
+
* What a live switch shows over the scene being left: the veil, the loader and the transition. The scene being left
|
|
13852
|
+
* decides: its `leave` is merged field by field over `config.leave`, which is merged over the engine's default (`{ cover:
|
|
13853
|
+
* { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } }`, and no transition). `false`
|
|
13854
|
+
* turns a part or the whole off; a part written over `false` starts from the engine's default. `transition` is no
|
|
13855
|
+
* merge: the level that writes one replaces the one below whole, and `transition: false` turns it off for this scene
|
|
13856
|
+
* (the scene being entered then cannot turn it on). The scene being entered may set the veil's `color` and `alpha` and
|
|
13857
|
+
* the transition on top (`enter`). Fast mode, a headless app and the first scene of a run show nothing. A scene may also
|
|
13858
|
+
* write a function of the switch that gives one (`SceneSpec.leave`).
|
|
13621
13859
|
*
|
|
13622
13860
|
* @example
|
|
13623
13861
|
* ```ts
|
|
@@ -13626,11 +13864,15 @@ type SceneLoader<Asset extends string = string> = {
|
|
|
13626
13864
|
* const ward: SceneLeave = false;
|
|
13627
13865
|
* // The veil without a loader.
|
|
13628
13866
|
* const quiet: SceneLeave = { loader: false };
|
|
13867
|
+
* // A wipe from right to left over the new scene, and the map leaves with none.
|
|
13868
|
+
* const wiped: SceneLeave = { transition: { kind: "wipe", angle: Math.PI } };
|
|
13869
|
+
* const map: SceneLeave = { transition: false };
|
|
13629
13870
|
* ```
|
|
13630
13871
|
*/
|
|
13631
13872
|
type SceneLeave<Asset extends string = string> = {
|
|
13632
13873
|
cover?: SceneCover | false;
|
|
13633
|
-
loader?: SceneLoader<Asset> | false;
|
|
13874
|
+
loader?: SceneLoader<Asset> | false; /** The transition from the last frame of this scene to the next one; `false` turns the config's off. Absent: the config's. */
|
|
13875
|
+
transition?: SceneTransition | false;
|
|
13634
13876
|
} | false;
|
|
13635
13877
|
/**
|
|
13636
13878
|
* The switch a `leave` function is asked about: the ids of the scene being left and of the scene being switched to. A
|
|
@@ -13652,17 +13894,22 @@ type LeaveSwitch = {
|
|
|
13652
13894
|
* What a live switch to this scene shows over the scene being left: the veil takes this scene's `color` and `alpha`,
|
|
13653
13895
|
* each over what the scene being left resolved (its `leave` over `config.leave` over the engine's). Only the look of
|
|
13654
13896
|
* the veil: `inMs` and `outMs` stay the left scene's, and a veil the scene being left turned off (`cover: false`)
|
|
13655
|
-
* stays off, as `enter` never turns one on.
|
|
13897
|
+
* stays off, as `enter` never turns one on. `transition` replaces whatever transition the scene being left resolved,
|
|
13898
|
+
* whole, except `false` of that scene (`leave: false`, or `transition: false`), which no `enter` turns on again.
|
|
13899
|
+
* Absent: the scene being left decides alone.
|
|
13656
13900
|
*
|
|
13657
13901
|
* @example
|
|
13658
13902
|
* ```ts
|
|
13659
13903
|
* // Every way into the night scene dims the scene being left in navy at 70 %: ward → night shows the veil
|
|
13660
13904
|
* // { color: 0x0b1020, alpha: 0.7, inMs: 50, outMs: 150 } over a ward that leaves with the engine's.
|
|
13661
13905
|
* const enter: SceneEnter = { cover: { color: 0x0b1020, alpha: 0.7 } };
|
|
13906
|
+
* // ... and closes the old picture into the centre of the screen over 500 ms.
|
|
13907
|
+
* const night: SceneEnter = { transition: { kind: "iris", ms: 500 } };
|
|
13662
13908
|
* ```
|
|
13663
13909
|
*/
|
|
13664
13910
|
type SceneEnter = {
|
|
13665
|
-
/** The `color` and the `alpha` of the veil of a switch to this scene. */cover?: Pick<SceneCover, "color" | "alpha">;
|
|
13911
|
+
/** The `color` and the `alpha` of the veil of a switch to this scene. */cover?: Pick<SceneCover, "color" | "alpha">; /** The transition of every switch to this scene, over the one the scene being left writes. */
|
|
13912
|
+
transition?: SceneTransition;
|
|
13666
13913
|
};
|
|
13667
13914
|
/**
|
|
13668
13915
|
* What the author passes to `defineScene`. The layer names come from the keys of `layers` plus
|
|
@@ -13714,7 +13961,11 @@ type SceneSpec<Layers extends LayerMap, Projections extends readonly AnyScenePro
|
|
|
13714
13961
|
* });
|
|
13715
13962
|
* ```
|
|
13716
13963
|
*/
|
|
13717
|
-
leave?: SceneLeave<Asset> | ((sw: LeaveSwitch) => SceneLeave<Asset> | undefined);
|
|
13964
|
+
leave?: SceneLeave<Asset> | ((sw: LeaveSwitch) => SceneLeave<Asset> | undefined);
|
|
13965
|
+
/**
|
|
13966
|
+
* What a live switch to this scene shows: the `color` and `alpha` of the veil over the scene being left, and the
|
|
13967
|
+
* transition that replaces the one the scene being left writes.
|
|
13968
|
+
*/
|
|
13718
13969
|
enter?: SceneEnter;
|
|
13719
13970
|
};
|
|
13720
13971
|
/**
|
|
@@ -13811,7 +14062,8 @@ type Config$1 = {
|
|
|
13811
14062
|
/**
|
|
13812
14063
|
* What a live switch shows over the scene being left, for every scene; a scene's own `leave` is merged over it field
|
|
13813
14064
|
* by field. A field left out keeps the engine's default, `{ cover: { color: 0x000000, alpha: 0.45, inMs: 50,
|
|
13814
|
-
* outMs: 150 }, loader: { afterMs: 400 } }`, which holds no swap (no `holdMs`); `false` turns
|
|
14065
|
+
* outMs: 150 }, loader: { afterMs: 400 } }`, which holds no swap (no `holdMs`) and plays no transition; `false` turns
|
|
14066
|
+
* a part or the whole off. `transition` is the game-wide transition of a live switch (spec 36).
|
|
13815
14067
|
*
|
|
13816
14068
|
* @example
|
|
13817
14069
|
* ```ts
|
|
@@ -13825,6 +14077,11 @@ type Config$1 = {
|
|
|
13825
14077
|
* plugins: [...screen, boardFeature],
|
|
13826
14078
|
* pluginConfigs: { scenes: { leave: { loader: { afterMs: 0, holdMs: 260, projection: "opening" } } } }
|
|
13827
14079
|
* });
|
|
14080
|
+
* // Every switch fades the last frame of the scene being left out over the next scene in 400 ms.
|
|
14081
|
+
* createApp({
|
|
14082
|
+
* plugins: [...screen, boardFeature],
|
|
14083
|
+
* pluginConfigs: { scenes: { leave: { transition: { kind: "fade" } } } }
|
|
14084
|
+
* });
|
|
13828
14085
|
* // No veil and no loader on any switch.
|
|
13829
14086
|
* createApp({ plugins: [...screen, boardFeature], pluginConfigs: { scenes: { leave: false } } });
|
|
13830
14087
|
* ```
|
|
@@ -13953,7 +14210,11 @@ type Leaving = {
|
|
|
13953
14210
|
* The loader projection the switch mounted or showed once its loader was due: unmounted at once at a drop, faded out
|
|
13954
14211
|
* with the veil after a land. Absent while it mounted and showed none.
|
|
13955
14212
|
*/
|
|
13956
|
-
projection?: string;
|
|
14213
|
+
projection?: string;
|
|
14214
|
+
/**
|
|
14215
|
+
* Milliseconds the veil fades out over after the swap, 0 without a veil: a loader shown goes with it. A transition
|
|
14216
|
+
* that was played at the swap sets it to 0: the veil and the loader are in its picture and leave at once.
|
|
14217
|
+
*/
|
|
13957
14218
|
outMs: number;
|
|
13958
14219
|
/**
|
|
13959
14220
|
* The floor on the swap (F130), for a loader that is on with `holdMs` above 0: the clock moment the swap may happen at,
|
|
@@ -13966,6 +14227,15 @@ type Leaving = {
|
|
|
13966
14227
|
elapsedUntil: number;
|
|
13967
14228
|
frame: number;
|
|
13968
14229
|
};
|
|
14230
|
+
/**
|
|
14231
|
+
* The gate of a look that carries a transition (spec 36): the frames the swap waited for the picture, and whether
|
|
14232
|
+
* the renderer answered it was taken, so the commit plays it right after the swap. Absent for a look without one:
|
|
14233
|
+
* the swap asks the renderer for nothing.
|
|
14234
|
+
*/
|
|
14235
|
+
transition?: {
|
|
14236
|
+
captureFrames: number;
|
|
14237
|
+
ready: boolean;
|
|
14238
|
+
};
|
|
13969
14239
|
/**
|
|
13970
14240
|
* The loader projection the switch feeds its `SceneSwitch` (F107 part 1), from its start to its swap or drop. Absent
|
|
13971
14241
|
* when it feeds none: a ring, a texture, a loader turned off, or a projection another owner shows.
|
|
@@ -14018,11 +14288,13 @@ type FullLoader = {
|
|
|
14018
14288
|
projection?: string;
|
|
14019
14289
|
};
|
|
14020
14290
|
/**
|
|
14021
|
-
* What a switch shows over the scene being left, every level merged: each part resolved or off
|
|
14291
|
+
* What a switch shows over the scene being left, every level merged: each part resolved or off, and the transition
|
|
14292
|
+
* with every field filled when one is resolved.
|
|
14022
14293
|
*/
|
|
14023
14294
|
type FullLeave = {
|
|
14024
14295
|
cover: FullCover | false;
|
|
14025
14296
|
loader: FullLoader | false;
|
|
14297
|
+
transition?: Readonly<LeaveTransition>;
|
|
14026
14298
|
};
|
|
14027
14299
|
/**
|
|
14028
14300
|
* scenes plugin events.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as Config$2, Hr as Config, Ir as ClockSource, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Un as TypeTag, Wr as Json, Xr as ProviderCall, Yr as PlayerStateProvider, Zr as SaveDoc, _t as Orientation, a as Config$3, d as Manifest, ei as SnapshotOf, gn as Config$1, it as PixiModule, n as AssetsIo } from "./types-
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-
|
|
4
|
-
import { Rt as effectsPlugin, Vt as audioPlugin, i as screen, jt as PlatformProvider, kt as platformPlugin, t as createApp } from "./index-
|
|
1
|
+
import { $ as Config$2, Hr as Config, Ir as ClockSource, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Un as TypeTag, Wr as Json, Xr as ProviderCall, Yr as PlayerStateProvider, Zr as SaveDoc, _t as Orientation, a as Config$3, d as Manifest, ei as SnapshotOf, gn as Config$1, it as PixiModule, n as AssetsIo } from "./types-D1xdKk_t.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-D-vnlN3n.mjs";
|
|
3
|
+
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-Bl9jyah_.mjs";
|
|
4
|
+
import { Rt as effectsPlugin, Vt as audioPlugin, i as screen, jt as PlatformProvider, kt as platformPlugin, t as createApp } from "./index-CVmEBBm5.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-
|
|
2
|
-
import { Y as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { R 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 { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-D1xdKk_t.mjs";
|
|
2
|
+
import { Y as AnimApi, r as UiApi } from "./types-D-vnlN3n.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-Bl9jyah_.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-DFkrIVO4.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-CM7Ng3EN.mjs";
|
|
6
|
+
import { t as commands } from "./commands-CLhKYlot.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. */
|
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-D_4mmn1u.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/llms.txt
CHANGED
|
@@ -565,6 +565,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
565
565
|
- HUD: a scene layer `{ above: "overlays" }` is the HUD layer, drawn above every overlay and never in a picture; a scene with a HUD layer and no `ui` gets `ui` right under it. Its roots never take the keyboard: Escape and the Back press reach the top sheet under it. `HudPart({ key })` tags a HUD view; an overlay's `hud` (`"all"`, `"none"` or keys) names the parts that stay shown, the others fade with its level and take no tap. `hud: "under"` draws the whole HUD layer under the overlay's own dim instead, dimmed with the rest (one Pixi `RenderLayer` right before the dim; the HUD and the veil each drawn once): `Overlay({ dim: 0.82, dimColor: 0x1e161a, hud: "under" })`. While held the HUD takes no tap; the topmost such overlay holds it, and a sheet without `"under"` over it shows the HUD above again until it goes; with `dim: 0` it is `"all"`. Keys are typed by `defineGame<{ …, hud: "energy" | "gems" }>()`.
|
|
566
566
|
- Endless loops of views under an opaque or blurred overlay write nothing (`renderer.sync.loopsHeld(entity)`, the seam anim asks before an endless loop writes); their phase follows time.
|
|
567
567
|
- Scene switch look: from the start of a live switch (before its bundles and textures are awaited) the renderer draws a veil over the scene being left, above every layer, and, when the switch is not done `afterMs` after its start, a loader above it until the swap; then the veil fades out over the new scene. Config `scenes.leave` (default `{ cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } }`) and a scene's `leave` (`defineScene("ward", { ..., leave: false })`) are merged field by field (the scene being left decides; `false` turns a part or the whole off); the loader is the engine's white ring, `loader: { texture: "ui.loader.ring" }` a game texture turning, or `loader: { projection: "loading" }` a projection in a layer of its own the scene declares (no other projection of the scene may draw there), kept built and hidden while the scene stands and shown once the loader is due; `scenes` feeds that loader the switch (`projection.feed`), so its `from(player, session, sw)` reads a `SceneSwitch`: `{ from: "ward", to: "ward", progress: 0 }` while the ward stands, then `{ from: "ward", to: "board", progress }`, the share of the board's bundles loaded (from `assets:bundle-progress`; a bundle loaded at the start or once the scene stage has its loads counts whole), 0 to 1 in steps of 0.01, the last exactly 1; `loader: { holdMs: 260 }` (default 0) is a floor on the swap: the next scene builds at once and the old one stays until 260 ms after the switch start (on the clock or in game time, whichever passes first, so a visual test's stepped frames pass it while its fake clock stands, F156) and one drawn frame of the look, so a switch slower than it gets nothing added; an abort or a throw drops both at once; fast walks, a world that is not live, headless apps and the first scene show nothing and hold nothing. The scene being entered sets the veil's colour and alpha: `defineScene("night", { ..., enter: { cover: { color: 0x0b1020, alpha: 0.7 } } })` wins over what the scene being left resolved, field by field; `inMs`/`outMs` stay the left scene's and a veil turned off stays off. Types `SceneLeave`, `SceneCover`, `SceneLoader`, `SceneEnter` (`Scenes`).
|
|
568
|
+
- Scene transitions (F126): `leave: { transition: { kind: "wipe", angle: Math.PI } }` on the scene being left (or `scenes.leave.transition` for the game, `transition: false` off), `enter: { transition: { kind: "iris", ms: 500 } }` on the scene entered (wins over the left scene's, never turns on a `false`). Kinds `fade`, `slide` (`to`), `wipe` (`angle`, 0 moves the edge left to right; `soft`), `iris` (`x`, `y` shares of the screen; `soft`), `dissolve` (`scale`, `edge`, `edgeColor`); common `ms` (400), `ease` ("inOut"), `reduced` ("cut" skips it under reduced motion, "keep" plays it). The swap waits one frame, the renderer copies that last frame (a copy, no render pass) and draws it over the new scene for `ms`: fade and slide as a sprite, wipe, iris and dissolve on a quad with the body of `RevealLine`, `RevealRound`, `Dissolve`, which a feature must list in `filters` (else it plays as fade and a dev build warns `renderer:transition-body-missing`). The picture takes no tap and is freed at the end. Headless, fast walks, the first scene, a one-block switch and WebGL play none. Type `SceneTransition` (`Scenes`).
|
|
568
569
|
- A scene names bundles on top of its `bundle` from the committed state: `defineScene("ward", { bundle: "episodes-kit", bundles: ({ session }) => [session.episode], layers: {}, projections: [wardRoom] })`. `bundles` is read each time a node enters the scene, and every way in (a live entry, a restore, the `safeNode` recovery) waits for all of them before the scene is mounted and the node's gate opens. The keys are `BundleKey`s of `generated/assets.ts`.
|
|
569
570
|
- `app.assets`: `load(bundle)`, `warm(bundle)` (loads it if needed, then puts its textures and atlas pages on the GPU through `renderer.sync.textures.upload`, `renderer.uploads` a drawn frame; joins a running or finished warm; an unload forgets it; resolves also when the renderer could not upload; headless at once), `unload(bundle)`, `isLoaded(bundle)`, `has(bundle)` (the manifest carries it, loaded or not), `texture(key)`, `font(key)`, `audio(key)`, `usage()`. Per bundle in a feature's `assets.ts`: `defineBundles({ ep01: { tier: "feature", release: "leave", mipmaps: ["items/**"] } })`. `release: "leave"` also unloads the bundle, with reason `"leave"`, at the next rest once nothing holds it: not pinned by the node entered, not named by the mounted scene, no node of its feature on the stack; a bundle the outgoing scene named leaves one rest later. The default `"budget"` leaves only under the texture budget. `mipmaps` (`true` or globs relative to `assets/`) uploads the textures with their full chain; such a texture stays loose in a pack. A sub-feature with resources gets its own bundles, named like its folder, with `dir` and `parent` in the manifest; a code-only one has none. The effect `ready(bundle | bundles)` (root export, also from `defineGame`) lets a node rest on a load and stay answerable: its handler (fast mode too) answers `true` headless, throws for an unknown bundle, answers `true` when every bundle is loaded and warmed or its last warm failed (`ctx.log.warn("assets:ready-failed", { bundle, error })`, cleared by a later successful load), otherwise starts `warm` for what is missing, answers `false` and posts `{ type: "ready" }` into `flow.inbox` once all of it settled; in live mode it also answers `false` while a warm view is in work (`world.projection.left()` finite) and posts once that build ended, at most 400 ms (game clock) after the bundles settled (F202). Recipe: a rest node `inbox: ["elapsed", "ready"]` with outcomes `ready` and `back`, and a transit node `if ((await fx(ready(list))) === false) return out.wait();`. `companions.add({ load(bundle), unload(bundle) })` adds what loads and unloads with every bundle; `i18n` adds the strings of a sub-feature that way, only when `assets` is composed. Events `assets:bundle-loaded`, `assets:bundle-progress`, `assets:bundle-unloaded` (`reason: "budget" | "request" | "leave"`), `assets:replaced` (dev). Config: `manifest`, `textureBudgetMb: 192`, `preloadDepth: 2`, `baseUrl`, `io`.
|
|
570
571
|
- `resource(name, defaults)` clones plain JSON defaults into every world. `resource(name, () => value)` calls the factory once per world on first read, so the value may hold a `Map` or a function: `const Looks = resource("boardLooks", () => ({ shown: new Map<World.Entity, { look: string }>() }))`. A system keeps its own state there; `snapshot()` leaves a value that is not JSON out.
|