@moku-labs/game 0.15.97 → 0.15.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/app/page.d.mts +1 -1
- package/dist/app/system.d.mts +2 -2
- package/dist/app.d.mts +1 -1
- package/dist/app.mjs +1 -1
- package/dist/{commands-DQXSQB_C.d.mts → commands-CnGF1AfS.d.mts} +1 -1
- package/dist/control.d.mts +1 -1
- package/dist/{index-U_AN5j0L.d.mts → index-E62NqrO6.d.mts} +49 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/inspect.d.mts +1 -1
- package/dist/{src-C32BYdgi.mjs → src-GFqUAdoU.mjs} +249 -4
- package/dist/testing.d.mts +2 -2
- package/dist/testing.mjs +1 -1
- package/dist/{types-Brsj29M-.d.mts → types-Ddezbux2.d.mts} +2 -2
- package/dist/{types-Cffn9Rbm.d.mts → types-DeybZgVT.d.mts} +58 -2
- package/dist/{visual-72OVwKM4.d.mts → visual-BziiITWm.d.mts} +2 -2
- package/dist/visual.d.mts +1 -1
- package/llms.txt +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -236,7 +236,7 @@ createApp({ plugins: [...screen, effectsPlugin, audioPlugin, platformPlugin] });
|
|
|
236
236
|
| [`i18n`](./src/plugins/i18n/README.md) | screen | Strings as data, ICU messages, compiled per locale; a sub-feature's strings travel with its bundle |
|
|
237
237
|
| [`text`](./src/plugins/text/README.md) | screen | MSDF text, styles, inline tags and icons |
|
|
238
238
|
| [`ui`](./src/plugins/ui/README.md) | screen | Screens in JSX, Yoga layout, popups, styles |
|
|
239
|
-
| [`effects`](./src/plugins/effects/README.md) | opt-in | Particles and filters as components, WGSL and GLSL |
|
|
239
|
+
| [`effects`](./src/plugins/effects/README.md) | opt-in | Particles and filters as components, WGSL and GLSL; the effect set `Flash`, `Grade`, `Vignette` ready to list ([set](./src/plugins/effects/set/README.md)) |
|
|
240
240
|
| [`audio`](./src/plugins/audio/README.md) | opt-in | Music and sound effects on three buses |
|
|
241
241
|
| [`platform`](./src/plugins/platform/README.md) | opt-in | The phone: Back button, haptics, keep-awake |
|
|
242
242
|
|
package/dist/app/page.d.mts
CHANGED
package/dist/app/system.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { qr as PlayerStateProvider } from "../types-qCcSw8YI.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-
|
|
2
|
+
import { yt as PlatformProvider } from "../index-E62NqrO6.mjs";
|
|
3
|
+
import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-Ddezbux2.mjs";
|
|
4
4
|
import { Back, Haptics, KeepAwake, Lifecycle, Store } from "@moku-labs/system";
|
|
5
5
|
|
|
6
6
|
//#region src/app/system.d.ts
|
package/dist/app.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Hr as Json } from "./types-qCcSw8YI.mjs";
|
|
2
2
|
import { q as StringTable } from "./types-L3E-YS4N.mjs";
|
|
3
|
-
import { _ as SystemName, a as GameHandle, c as MemoryProvider, d as PlistValue, f as SaveKind, i as GameDefinition, l as PageAgent, m as ScreenSeams, n as GameApp, o as GamePluginConfigs, p as Scenario, r as GameConfig, s as HeadlessSeams, y as WithGameState } from "./types-
|
|
3
|
+
import { _ as SystemName, a as GameHandle, c as MemoryProvider, d as PlistValue, f as SaveKind, i as GameDefinition, l as PageAgent, m as ScreenSeams, n as GameApp, o as GamePluginConfigs, p as Scenario, r as GameConfig, s as HeadlessSeams, y as WithGameState } from "./types-Ddezbux2.mjs";
|
|
4
4
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
5
5
|
|
|
6
6
|
//#region src/app/define.d.ts
|
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dt as effectsPlugin, G as platformPlugin, Rt as audioPlugin, _ as flattenFeatures, i as screen, t as createApp } from "./src-GFqUAdoU.mjs";
|
|
2
2
|
import { t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { n as fakeClock, r as isFakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
//#region src/app/define.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $r as StoreApi, D as DebugSwitches, In as FlowState, Nn as Bookmark, Or as Api$2, Z as Api$1, Zr as Snapshot, ft as Captured, mi as Time, ni as Api, ui as FrameRate, w as ScenesApi } from "./types-qCcSw8YI.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { L as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-DeybZgVT.mjs";
|
|
3
3
|
import { L as InputApi } from "./types-L3E-YS4N.mjs";
|
|
4
4
|
import { t as HeadlessApp } from "./headless-Co3SEFi5.mjs";
|
|
5
5
|
import { i as ControlApp, r as Command } from "./types-BE6tcAFX.mjs";
|
package/dist/control.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as HeadlessApp } from "./headless-Co3SEFi5.mjs";
|
|
2
2
|
import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-BE6tcAFX.mjs";
|
|
3
|
-
import { t as commands } from "./commands-
|
|
3
|
+
import { t as commands } from "./commands-CnGF1AfS.mjs";
|
|
4
4
|
import { t as defineCommand } from "./define-hPbGjPAY.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/dev.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $n as Ease, $r as StoreApi, An as FeaturePlugin, Bn as SceneIdOf, Br as Config$5, C as SceneSpec, Cr as QueryTerm, Dr as TagType, Er as SystemFor, F as HudPartValue, Fr as Config$2, Ft as PassKind, G as SpriteOptions, Gn as GuideOptions, H as ShapeValue, Hn as Descriptor, Hr as Json, J as TransformValue, K as SpriteValue, Kn as Hint, Kr as Patch, L as NineSliceValue, Lr as State$2, Nr as Api$1, Or as Api$6, Pn as DefineNode, Q as Config$6, Qn as DescriptionNode, S as SceneDefinition, Sr as Narrowed, T as State$7, Tr as SystemDefinition, Tt as FrameRing, Un as Effect, Ur as Root, Wn as EffectOptions, Wr as State$5, Y as sprite, Yn as Answered, Z as Api$4, _ as AnySceneProjection, _i as Events$1, _n as HudKeysOf, _r as ComponentValue, _t as ViewportSize, a as Config$1, ai as PauseReason, ar as ProjectionSpec, bn as TextFormatsOf, c as LoadBundles, ci as Api$5, di as RateChange, ei as RngApi, f as ReadyBundles, fi as State$8, fn as Api$2, gi as Config$10, gn as GameTypes, gr as ComponentType, hn as EmitterIdOf, i as BundleSpec, ii as Events, ir as ProjectionMotion, jn as FeatureTree, jr as State$9, kn as FeatureDescription, kr as Config$9, l as LoadReason, li as Config$8, m as Tier, mn as Config$3, mr as ComponentHandle, ni as Api$3, o as DefineBundles, oi as State$4, or as ReducedMotion, p as State$1, pi as ThermalReading, pn as BundlesOf, r as BundleMap, ri as Config$4, rr as NumericFields, st as State$6, t as Api, u as LoadResult, v as Config$7, vi as Require, w as ScenesApi, wn as defineFlow, wr as ResourceType, wt as FrameRecord, x as LayerMap, xn as TextStylesOf, xr as Mut, y as DefineScene, yn as State$3, z as OverlayValue } from "./types-qCcSw8YI.mjs";
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as FilterComponent, B as FramesValue, C as EmitterDefinition, D as ColorMatrixValue, E as BlurValue, F as OutlineValue, G as HapticKind, H as State$10, I as UniformDeclaration, K as SfxDescriptor, L as AnimApi, M as FilterValueOf, N as GlowValue, O as DisplacementValue, P as NoiseValue, R as AnimPlayerValue, S as EmitterConfig, T as AlphaValue, U as Target, V as MotionKeyframe, Y as defineAnimation, _ as State$12, a as AudioApi, b as GradeValue, c as MusicDescriptor, d as State$11, f as VolumesFor, ft as OverlayApi, h as EffectsApi, j as FilterSpec, l as MusicOptions, m as Config$13, n as State$13, q as Step, r as UiApi, s as Config$12, t as Config$14, tt as play, w as EmitterValue, x as VignetteValue, y as FlashValue, z as Config$11 } from "./types-DeybZgVT.mjs";
|
|
3
3
|
import { $ as Style, A as TextFormats, B as Argument, C as Point, E as TextBind, F as defineComponent, G as Part, H as I18nApi, I as Config$16, J as TextKey, K as State$14, L as InputApi, M as TextStyles, N as TextValue, Q as ResolvedStyle, R as State$15, T as TextApi, U as IntlKit, V as Config$15, W as Message, Y as TypedTr, Z as IsFlags, b as Config$17, g as IntrinsicElementsFor, h as defineTokens, j as TextStyleInput, k as TextFormatFunction, s as PopupComponent, tt as WhenFlags, v as BindField, w as State$16, x as CountdownValue, y as BindOptions } from "./types-L3E-YS4N.mjs";
|
|
4
4
|
import { Log } from "@moku-labs/common/browser";
|
|
5
5
|
import { PluginCtx } from "@moku-labs/core";
|
|
@@ -1758,6 +1758,53 @@ declare const Alpha: ComponentType<AlphaValue>;
|
|
|
1758
1758
|
*/
|
|
1759
1759
|
declare function defineFilter<Uniforms extends Record<string, UniformDeclaration> = Record<never, never>>(id: string, spec: FilterSpec<Uniforms>): FilterComponent<FilterValueOf<Uniforms>>;
|
|
1760
1760
|
//#endregion
|
|
1761
|
+
//#region src/plugins/effects/set/flash.d.ts
|
|
1762
|
+
/**
|
|
1763
|
+
* A view washed with `color` by `amount`: 0 draws the view as it is, 1 draws its shape in `color`, its alpha kept.
|
|
1764
|
+
* For a hit, a pick, a merge: tween `amount` up and down. List it in a feature's `filters`, as a game's own filter.
|
|
1765
|
+
* One render pass, one sample; on WebGPU a tween draws on the view's own quad, no pass, from its third frame.
|
|
1766
|
+
*
|
|
1767
|
+
* @example
|
|
1768
|
+
* ```ts
|
|
1769
|
+
* // features/board/feature.ts lists it: filters: [Flash]. A merged piece flashes gold, then a motion fades it out.
|
|
1770
|
+
* Flash({ amount: 1, color: 0xffd700 }).value; // { amount: 1, color: 0xffd700, enabled: true, order: 0 }
|
|
1771
|
+
* view.tween(Flash, { amount: 0 }, { ms: 160 });
|
|
1772
|
+
* ```
|
|
1773
|
+
*/
|
|
1774
|
+
declare const Flash: FilterComponent<FlashValue>;
|
|
1775
|
+
//#endregion
|
|
1776
|
+
//#region src/plugins/effects/set/grade.d.ts
|
|
1777
|
+
/**
|
|
1778
|
+
* A colour grade of a view: `contrast` about the middle grey, then `brightness`, then `saturation` against the luma,
|
|
1779
|
+
* then a multiply by `tint`. Each number is 1 for no change, 0..2; `saturation: 0` is grey. The alpha is kept. In place
|
|
1780
|
+
* of `ColorMatrix` where a value moves: on WebGPU a tween draws on the view's own quad, no pass, from its third frame.
|
|
1781
|
+
* List it in a feature's `filters`, as a game's own filter. One render pass, one sample.
|
|
1782
|
+
*
|
|
1783
|
+
* @example
|
|
1784
|
+
* ```ts
|
|
1785
|
+
* // A locked level card goes grey, and a kept picture holds it: a still view pays no pass.
|
|
1786
|
+
* Grade({ saturation: 0 }).value.saturation; // 0
|
|
1787
|
+
* Grade.filter.cache; // "local"
|
|
1788
|
+
* ```
|
|
1789
|
+
*/
|
|
1790
|
+
declare const Grade: FilterComponent<GradeValue>;
|
|
1791
|
+
//#endregion
|
|
1792
|
+
//#region src/plugins/effects/set/vignette.d.ts
|
|
1793
|
+
/**
|
|
1794
|
+
* A view darkened outside a disc: inside `radius` of the point `x`, `y` it is drawn as it is, from there over `soft` it
|
|
1795
|
+
* fades to `color`, by `amount`. The point and the lengths are in 0..1 of the view on each axis, so on a view twice as
|
|
1796
|
+
* wide as tall the disc is an ellipse. The alpha is kept. List it in a feature's `filters`, as a game's own filter. One
|
|
1797
|
+
* render pass, one sample; on WebGPU a tween draws on the view's own quad, no pass, from its third frame.
|
|
1798
|
+
*
|
|
1799
|
+
* @example
|
|
1800
|
+
* ```ts
|
|
1801
|
+
* // A dream scene closes in at the edges, then the vignette fades away as the player wakes.
|
|
1802
|
+
* Vignette({ radius: 0.3, soft: 0.4 }).value.amount; // 1
|
|
1803
|
+
* view.tween(Vignette, { amount: 0 }, { ms: 300 });
|
|
1804
|
+
* ```
|
|
1805
|
+
*/
|
|
1806
|
+
declare const Vignette: FilterComponent<VignetteValue>;
|
|
1807
|
+
//#endregion
|
|
1761
1808
|
//#region src/plugins/effects/particles/component.d.ts
|
|
1762
1809
|
/**
|
|
1763
1810
|
* A particle effect on an entity. A `burst` effect emits when the component appears or its
|
|
@@ -2076,4 +2123,4 @@ declare const screen: readonly [import("@moku-labs/core").PluginInstance<"world"
|
|
|
2076
2123
|
};
|
|
2077
2124
|
}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"text", Config$17, State$16, TextApi, {}> & Record<never, never>, import("@moku-labs/core").PluginInstance<"ui", Config$14, State$13, UiApi, {}> & Record<never, never>];
|
|
2078
2125
|
//#endregion
|
|
2079
|
-
export {
|
|
2126
|
+
export { Tree as $, defineBundles as A, assetsPlugin as At, Pressed as B, messageDuration as C, inputPlugin as Ct, Animation as D, debugPlugin as Dt, AnimPlayer as E, effectsPlugin as Et, Held as F, bind as Ft, Traceable as G, TapValue as H, Hovered as I, defineTextFormats as It, frameAt as J, Traced as K, Pointer as L, defineTextStyles as Lt, ready as M, projection as Mt, Draggable as N, Countdown as Nt, Frames as O, clockPlugin as Ot, DropTarget as P, Text as Pt, Order as Q, PointerOver as R, label as Rt, messageArgument as S, lifecyclePlugin as St, defineMotion as T, flowPlugin as Tt, Tappable as U, Swipeable as V, Touchable as W, Layer as X, Exiting as Y, Now as Z, Outline as _, platformPlugin as _t, defineEmitter as a, defineEffect as at, defineStyle as b, types_d_exports as bt, Grade as c, schedule as ct, Alpha as d, worldPlugin as dt, component as et, Blur as f, uiPlugin as ft, Noise as g, rendererPlugin as gt, Glow as h, scenesPlugin as ht, screen as i, tag as it, load as j, animPlugin as jt, defineScene as k, audioPlugin as kt, Flash as l, defineFeature as lt, Displacement as m, textPlugin as mt, createPlugin as n, resource as nt, Emitter as o, guide as ot, ColorMatrix as p, timePlugin as pt, PASS_KINDS as q, defineGame as r, system as rt, Vignette as s, hint as st, createApp as t, mut as tt, defineFilter as u, flattenFeatures as ut, music as v, BackResult as vt, cubicBezier as w, i18nPlugin as wt, tr as x, modelPlugin as xt, resolve as y, PlatformProvider as yt, Pressable as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as MonitorConfig, $t as PerfStartupLine, At as OverlayWhat, B as Parent, Bt as PerfCollectorLine, Cn as contribution, Ct as FrameReadout, Dn as to, Dt as MONITOR_SECTIONS, E as types_d_exports$13, En as slot, Et as LongFrameEntry, F as HudPartValue, Ft as PassKind, Gr as types_d_exports$10, Gt as PerfGapLine, Ht as PerfDisplay, I as NineSlice, It as PassRecord, Jt as PerfLongFrameLine, Kt as PerfHeaderLine, Lt as PerfCause, M as WhyEntry, Mr as types_d_exports$17, Mt as PERF_GAP_BUCKETS, N as Display, Nt as PERF_LOG_VERSION, On as type, Ot as MonitorSections, P as HudPart, Pt as PROBLEM_RULES, Qn as DescriptionNode, Qt as PerfSpikeLine, R as Overlay, Rr as types_d_exports$3, Rt as PerfChange, Sn as types_d_exports$6, St as FrameReadResult, Tn as exit, Tt as FrameRing, U as Sprite, Ut as PerfEventLine, V as Shape, Vt as PerfCounts, W as SpriteBlend, Wt as PerfEventName, X as AdaptiveScale, Xn as AnchorTarget, Xr as SaveUnreadableError, Xt as PerfMeasured, Y as sprite, Yt as PerfMarkLine, Zt as PerfSampleLine, an as SHADER_WHATS, bt as WhyLive, cn as WarmDetail, dn as DEMAND_REASONS, dt as ShotsConfig, en as PerfTelemetryLine, g as types_d_exports$1, hi as types_d_exports$15, in as ProblemRule, jt as PERF_CAUSES, kt as OverlayEventDetail, ln as CANVAS_RESTARTS, lt as types_d_exports$12, nn as PoolTrimDetail, on as ShaderEventDetail, ot as PoolTrim, pt as MonitorCounts, q as Transform, qt as PerfLogLine, rn as ProblemEventDetail, si as types_d_exports$9, sn as ShaderWhat, sr as SceneSwitch, tn as PerfThermalLine, un as CanvasRestart, ut as ShotsApi, wt as FrameRecord, xt as FrameColumns, yt as RetakeWhy, z as OverlayValue, zt as PerfChangeEntry } from "./types-qCcSw8YI.mjs";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as mark, G as HapticKind, J as HAPTIC_KINDS, Q as haptic, W as types_d_exports, X as external, Y as defineAnimation, Z as frames, at as spawn, b as GradeValue, ct as stopSfx, dt as wait, et as parallel, i as types_d_exports$16, it as sfx, k as FilterArea, lt as tween, nt as sequence, ot as spawned, p as types_d_exports$2, pt as types_d_exports$4, rt as set, st as stagger, tt as play, ut as use, v as types_d_exports$5, x as VignetteValue, y as FlashValue } from "./types-DeybZgVT.mjs";
|
|
3
3
|
import { A as TextFormats, D as TextFormat, F as defineComponent, O as TextFormatAnswer, P as types_d_exports$14, S as FormattedNumber, X as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, k as TextFormatFunction, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions, z as types_d_exports$8 } from "./types-L3E-YS4N.mjs";
|
|
4
|
-
import { $ as
|
|
5
|
-
export { type AdaptiveScale, Alpha, type AnchorTarget, types_d_exports as Anim, AnimPlayer, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, type BackResult, type BindOptions, Blur, Box, CANVAS_RESTARTS, type CanvasRestart, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, DEMAND_REASONS, types_d_exports$4 as Debug, DebugTrigger, type DescriptionNode, Displacement, Display, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, types_d_exports$6 as Flow, type FormattedNumber, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, HAPTIC_KINDS, type HapticKind, Held, Hovered, HudPart, type HudPartValue, types_d_exports$7 as I18n, types_d_exports$8 as Input, Layer, types_d_exports$9 as Lifecycle, LocalWrite, type LongFrameEntry, MONITOR_SECTIONS, types_d_exports$10 as Model, type MonitorConfig, type MonitorCounts, type MonitorSections, NineSlice, Noise, Now, Order, Outline, Overlay, type OverlayEventDetail, type OverlayValue, type OverlayWhat, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, type PassKind, type PassRecord, type PerfCause, type PerfChange, type PerfChangeEntry, type PerfCollectorLine, type PerfCounts, type PerfDisplay, type PerfEventLine, type PerfEventName, type PerfGapLine, type PerfHeaderLine, type PerfLogLine, type PerfLongFrameLine, type PerfMarkLine, type PerfMeasured, type PerfSampleLine, type PerfSpikeLine, type PerfStartupLine, type PerfTelemetryLine, type PerfThermalLine, types_d_exports$11 as Platform, type PlatformProvider, Pointer, PointerOver, type PoolTrim, type PoolTrimDetail, Pressable, Pressed, type ProblemEventDetail, type ProblemRule, types_d_exports$12 as Renderer, type RetakeWhy, SHADER_WHATS, SaveUnreadableError, type SceneSwitch, types_d_exports$13 as Scenes, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, type ShotsApi, type ShotsConfig, Sprite, type SpriteBlend, Swipeable, type TapValue, Tappable, Text, type TextFormat, type TextFormatAnswer, type TextFormatFunction, type TextFormats, types_d_exports$14 as TextTypes, types_d_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$16 as Ui, type WarmDetail, type WhyEntry, type WhyLive, types_d_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextFormats, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
|
4
|
+
import { $ as Tree, A as defineBundles, At as assetsPlugin, B as Pressed, C as messageDuration, Ct as inputPlugin, D as Animation, Dt as debugPlugin, E as AnimPlayer, Et as effectsPlugin, F as Held, Ft as bind, G as Traceable, H as TapValue, I as Hovered, It as defineTextFormats, J as frameAt, K as Traced, L as Pointer, Lt as defineTextStyles, M as ready, Mt as projection, N as Draggable, Nt as Countdown, O as Frames, Ot as clockPlugin, P as DropTarget, Pt as Text, Q as Order, R as PointerOver, Rt as label, S as messageArgument, St as lifecyclePlugin, T as defineMotion, Tt as flowPlugin, U as Tappable, V as Swipeable, W as Touchable, X as Layer, Y as Exiting, Z as Now, _ as Outline, _t as platformPlugin, a as defineEmitter, at as defineEffect, b as defineStyle, bt as types_d_exports$11, c as Grade, ct as schedule, d as Alpha, dt as worldPlugin, et as component, f as Blur, ft as uiPlugin, g as Noise, gt as rendererPlugin, h as Glow, ht as scenesPlugin, i as screen, it as tag, j as load, jt as animPlugin, k as defineScene, kt as audioPlugin, l as Flash, lt as defineFeature, m as Displacement, mt as textPlugin, n as createPlugin, nt as resource, o as Emitter, ot as guide, p as ColorMatrix, pt as timePlugin, q as PASS_KINDS, r as defineGame, rt as system, s as Vignette, st as hint, t as createApp, tt as mut, u as defineFilter, ut as flattenFeatures, v as music, vt as BackResult, w as cubicBezier, wt as i18nPlugin, x as tr, xt as modelPlugin, y as resolve, yt as PlatformProvider, z as Pressable } from "./index-E62NqrO6.mjs";
|
|
5
|
+
export { type AdaptiveScale, Alpha, type AnchorTarget, types_d_exports as Anim, AnimPlayer, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, type BackResult, type BindOptions, Blur, Box, CANVAS_RESTARTS, type CanvasRestart, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, DEMAND_REASONS, types_d_exports$4 as Debug, DebugTrigger, type DescriptionNode, Displacement, Display, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, Flash, type FlashValue, types_d_exports$6 as Flow, type FormattedNumber, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, Grade, type GradeValue, HAPTIC_KINDS, type HapticKind, Held, Hovered, HudPart, type HudPartValue, types_d_exports$7 as I18n, types_d_exports$8 as Input, Layer, types_d_exports$9 as Lifecycle, LocalWrite, type LongFrameEntry, MONITOR_SECTIONS, types_d_exports$10 as Model, type MonitorConfig, type MonitorCounts, type MonitorSections, NineSlice, Noise, Now, Order, Outline, Overlay, type OverlayEventDetail, type OverlayValue, type OverlayWhat, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, type PassKind, type PassRecord, type PerfCause, type PerfChange, type PerfChangeEntry, type PerfCollectorLine, type PerfCounts, type PerfDisplay, type PerfEventLine, type PerfEventName, type PerfGapLine, type PerfHeaderLine, type PerfLogLine, type PerfLongFrameLine, type PerfMarkLine, type PerfMeasured, type PerfSampleLine, type PerfSpikeLine, type PerfStartupLine, type PerfTelemetryLine, type PerfThermalLine, types_d_exports$11 as Platform, type PlatformProvider, Pointer, PointerOver, type PoolTrim, type PoolTrimDetail, Pressable, Pressed, type ProblemEventDetail, type ProblemRule, types_d_exports$12 as Renderer, type RetakeWhy, SHADER_WHATS, SaveUnreadableError, type SceneSwitch, types_d_exports$13 as Scenes, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, type ShotsApi, type ShotsConfig, Sprite, type SpriteBlend, Swipeable, type TapValue, Tappable, Text, type TextFormat, type TextFormatAnswer, type TextFormatFunction, type TextFormats, types_d_exports$14 as TextTypes, types_d_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$16 as Ui, Vignette, type VignetteValue, type WarmDetail, type WhyEntry, type WhyLive, types_d_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextFormats, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as play, $t as SHADER_WHATS, A as types_exports$10, At as Blur, B as types_exports, Bt as assetsPlugin, C as types_exports$17, Ct as Traced, D as types_exports$13, Dt as effectsPlugin, E as types_exports$14, Et as messageDuration, F as types_exports$5, Ft as Outline, G as platformPlugin, Gt as rendererPlugin, H as resolve, Ht as AnimPlayer, I as types_exports$4, It as defineFilter, J as external, Jt as MONITOR_SECTIONS, K as HAPTIC_KINDS, Kt as PASS_KINDS, L as types_exports$3, Lt as debugPlugin, M as types_exports$8, Mt as Displacement, N as types_exports$7, Nt as Glow, O as types_exports$12, Ot as Emitter, P as types_exports$6, Pt as Noise, Q as parallel, Qt as PROBLEM_RULES, R as types_exports$2, Rt as audioPlugin, S as ready, St as Traceable, T as types_exports$15, Tt as messageArgument, U as defineMotion, Ut as Animation, V as uiPlugin, Vt as animPlugin, W as textPlugin, Wt as Frames, X as haptic, Xt as PERF_GAP_BUCKETS, Y as frames, Yt as PERF_CAUSES, Z as mark, Zt as PERF_LOG_VERSION, _ as flattenFeatures, _t as Pressable, a as Vignette, an as contribution, at as stagger, b as defineBundles, bt as Tappable, c as cubicBezier, cn as to, ct as use, d as hint, dn as SaveUnreadableError, dt as Draggable, en as CANVAS_RESTARTS, et as sequence, f as schedule, fn as lifecyclePlugin, ft as DropTarget, g as defineFeature, gt as PointerOver, h as tr, ht as Pointer, i as screen, it as spawned, j as types_exports$9, jt as ColorMatrix, k as types_exports$11, kt as Alpha, l as defineEffect, ln as type, lt as wait, m as defineScene, mn as clockPlugin, mt as Hovered, n as createPlugin, nn as worldPlugin, nt as sfx, o as Grade, on as exit, ot as stopSfx, p as projection, pn as timePlugin, pt as Held, q as defineAnimation, qt as frameAt, r as defineGame, rn as flowPlugin, rt as spawn, s as Flash, sn as slot, st as tween, t as createApp, tn as DEMAND_REASONS, tt as set, u as guide, un as modelPlugin, ut as inputPlugin, v as defineEmitter, vt as Pressed, w as types_exports$16, wt as i18nPlugin, x as load, xt as Touchable, y as music, yt as Swipeable, z as types_exports$1, zt as scenesPlugin } from "./src-GFqUAdoU.mjs";
|
|
2
2
|
import { $ as Shape, A as Countdown, F as defineTextStyles, I as label, J as HudPart, M as bind, P as defineTextFormats, Q as Parent, S as popup, T as defineStyle, X as Overlay, Y as NineSlice, _ as LocalWrite, at as Exiting, ct as Order, dt as mut, et as Sprite, ft as resource, h as DebugTrigger, ht as tag, it as sprite, j as Text, lt as Tree, ot as Layer, p as Box, pt as system, q as Display, st as Now, tt as Transform, ut as component, w as defineTokens, y as ScrollState } from "./visual-DhqD6W3v.mjs";
|
|
3
3
|
import { t as defineComponent } from "./component-DGg5DqKK.mjs";
|
|
4
|
-
export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Blur, Box, CANVAS_RESTARTS, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, types_exports$6 as Flow, Frames, Glow, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shape, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextFormats, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
|
4
|
+
export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Blur, Box, CANVAS_RESTARTS, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, Flash, types_exports$6 as Flow, Frames, Glow, Grade, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shape, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, Vignette, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextFormats, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ar as Explained, Fn as FlowGraph, Ln as JournalEntry, Or as Api$1, Z as Api$2, Zr as Snapshot, br as FrameDiff, ct as Under, h as Usage, hr as ComponentSchema, mt as RenderStats, t as Api$3, vn as Position, yr as EntitySnapshot, zr as Api } from "./types-qCcSw8YI.mjs";
|
|
2
|
-
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-
|
|
2
|
+
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-DeybZgVT.mjs";
|
|
3
3
|
import { c as UiNode } from "./types-L3E-YS4N.mjs";
|
|
4
4
|
import { t as HeadlessApp } from "./headless-Co3SEFi5.mjs";
|
|
5
5
|
import { a as InputArguments, d as WatchApp, f as WatchInput, l as Source, o as InputOf, s as InputSchema, t as CheatEntry } from "./types-BE6tcAFX.mjs";
|
|
@@ -48385,6 +48385,29 @@ function emptyReaders() {
|
|
|
48385
48385
|
}
|
|
48386
48386
|
/** The definitions whose bodies read the screen: a dev build warns about the ones that declared no `cache: false`. */
|
|
48387
48387
|
const screenReaders = emptyReaders();
|
|
48388
|
+
/**
|
|
48389
|
+
* Creates the map of the components `defineFilter` made, by id. A function: the module-scope rule sees no collection
|
|
48390
|
+
* literal.
|
|
48391
|
+
*
|
|
48392
|
+
* @returns An empty map.
|
|
48393
|
+
*/
|
|
48394
|
+
function emptyMade() {
|
|
48395
|
+
return /* @__PURE__ */ new Map();
|
|
48396
|
+
}
|
|
48397
|
+
/**
|
|
48398
|
+
* Every component `defineFilter` made in a dev build, by id, the last one winning: a hot reload makes a new object
|
|
48399
|
+
* under the same id. The start of a dev build watches the ones no feature lists (`effects:filter-unlisted`). A release
|
|
48400
|
+
* build fills nothing, and drops the map with its one reader.
|
|
48401
|
+
*/
|
|
48402
|
+
const madeFilters = /*#__PURE__*/ emptyMade();
|
|
48403
|
+
/**
|
|
48404
|
+
* The components `defineFilter` made in a dev build, by id: nothing in a release build.
|
|
48405
|
+
*
|
|
48406
|
+
* @returns The map, read-only.
|
|
48407
|
+
*/
|
|
48408
|
+
function filtersMade() {
|
|
48409
|
+
return madeFilters;
|
|
48410
|
+
}
|
|
48388
48411
|
/** How bad a category is for the cache, for "the worst of": a screen read beats a placed one beats a local one. */
|
|
48389
48412
|
const WORST = {
|
|
48390
48413
|
local: 0,
|
|
@@ -48919,7 +48942,9 @@ function defineFilter(id, spec) {
|
|
|
48919
48942
|
["enabled", true],
|
|
48920
48943
|
["order", 0]
|
|
48921
48944
|
]);
|
|
48922
|
-
|
|
48945
|
+
const made = Object.assign(component(id, defaults), { filter });
|
|
48946
|
+
if (typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__) madeFilters.set(id, made);
|
|
48947
|
+
return made;
|
|
48923
48948
|
}
|
|
48924
48949
|
//#endregion
|
|
48925
48950
|
//#region src/plugins/effects/filters/glow-glsl.ts
|
|
@@ -53611,10 +53636,12 @@ function registerEmitters(ectx) {
|
|
|
53611
53636
|
}
|
|
53612
53637
|
/**
|
|
53613
53638
|
* Registers the filter kinds: the built-ins first, then the `filters` of every feature in
|
|
53614
|
-
* feature order. The order is each kind's `index`, the tie-break of the filters on a view.
|
|
53639
|
+
* feature order. The order is each kind's `index`, the tie-break of the filters on a view. An entry
|
|
53640
|
+
* that is the same component as one already read is skipped, so two features may list one member of
|
|
53641
|
+
* the effect set; the first feature's place sets its index.
|
|
53615
53642
|
*
|
|
53616
53643
|
* @param ectx - Domain context of the effects plugin.
|
|
53617
|
-
* @throws {Error} When
|
|
53644
|
+
* @throws {Error} When two components take one filter id, or one takes the id of a built-in.
|
|
53618
53645
|
*/
|
|
53619
53646
|
function registerKinds(ectx) {
|
|
53620
53647
|
const builtIns = builtInKinds();
|
|
@@ -53622,6 +53649,7 @@ function registerKinds(ectx) {
|
|
|
53622
53649
|
for (const entry of featureEntries(ectx, "filters")) {
|
|
53623
53650
|
const id = entry.filter.id;
|
|
53624
53651
|
if (builtIns.some((kind) => kind.id === id)) throw new Error(`[game] Filter "${id}" is built in.\n Choose another id.`);
|
|
53652
|
+
if (entries.some((kind) => kind.component === entry)) continue;
|
|
53625
53653
|
if (entries.some((kind) => kind.id === id)) throw new Error(`[game] Filter "${id}" is registered twice.\n Keep one defineFilter per id.`);
|
|
53626
53654
|
entries.push({
|
|
53627
53655
|
id,
|
|
@@ -53665,6 +53693,40 @@ function openWorld(ectx, kinds) {
|
|
|
53665
53693
|
const ecs = ectx.deps.world.ecs;
|
|
53666
53694
|
ectx.state.removers.push(ecs.system(createParticleSystem(ectx)), ecs.system(createOrphanSystem(ectx)), ecs.system(createFilterSystem(ectx)), ecs.onRemoved(Emitter, (entity) => forgetEmitter(ectx, entity)), ...kinds.map((kind) => ecs.onRemoved(kind.component, (entity) => forgetFilter(ectx, kind, entity))), ...kinds.map((kind) => ecs.onAdded(kind.component, (entity) => trackFilter(ectx, kind, entity))));
|
|
53667
53695
|
for (const kind of kinds) for (const [entity] of ecs.query(kind.component)) trackFilter(ectx, kind, entity);
|
|
53696
|
+
if (typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__) watchUnlisted(ectx);
|
|
53697
|
+
}
|
|
53698
|
+
/**
|
|
53699
|
+
* Watches every filter `defineFilter` made that no kind holds: a view that gets one draws unfiltered, so the first
|
|
53700
|
+
* such view of each id warns `effects:filter-unlisted`. An id the world holds under another object is skipped: a
|
|
53701
|
+
* second object of a known name would throw "defined twice". Dev builds only.
|
|
53702
|
+
*
|
|
53703
|
+
* @param ectx - Domain context of the effects plugin.
|
|
53704
|
+
*/
|
|
53705
|
+
function watchUnlisted(ectx) {
|
|
53706
|
+
const { ecs } = ectx.deps.world;
|
|
53707
|
+
for (const [id, component] of filtersMade()) {
|
|
53708
|
+
const known = ecs.typeOf(id);
|
|
53709
|
+
const heldByOther = known !== void 0 && !Object.is(known, component);
|
|
53710
|
+
if (ectx.state.kinds.has(id) || heldByOther) continue;
|
|
53711
|
+
ectx.state.removers.push(ecs.onAdded(component, (entity) => warnUnlisted(ectx, id, entity)));
|
|
53712
|
+
}
|
|
53713
|
+
}
|
|
53714
|
+
/**
|
|
53715
|
+
* Warns once per id that a view carries a filter no feature lists.
|
|
53716
|
+
*
|
|
53717
|
+
* @param ectx - Domain context of the effects plugin.
|
|
53718
|
+
* @param id - The filter id.
|
|
53719
|
+
* @param entity - The view that got it.
|
|
53720
|
+
*/
|
|
53721
|
+
function warnUnlisted(ectx, id, entity) {
|
|
53722
|
+
const key = `unlisted:${id}`;
|
|
53723
|
+
if (ectx.state.warned.has(key)) return;
|
|
53724
|
+
ectx.state.warned.add(key);
|
|
53725
|
+
ectx.log.warn("effects:filter-unlisted", {
|
|
53726
|
+
filter: id,
|
|
53727
|
+
entity,
|
|
53728
|
+
hint: `Filter "${id}" is on a view but no feature lists it in filters`
|
|
53729
|
+
});
|
|
53668
53730
|
}
|
|
53669
53731
|
/**
|
|
53670
53732
|
* Starts the plugin in `onStart`. The teardown closure goes first into `state.removers`, because
|
|
@@ -74299,6 +74361,189 @@ function cubicBezier(x1, y1, x2, y2) {
|
|
|
74299
74361
|
return (t) => progressAt(table, t);
|
|
74300
74362
|
}
|
|
74301
74363
|
//#endregion
|
|
74364
|
+
//#region src/plugins/effects/set/head.ts
|
|
74365
|
+
/**
|
|
74366
|
+
* @file effects/set — the set head: the WGSL and GLSL the engine's effect set puts before every member's body. Two
|
|
74367
|
+
* helpers: `inputPlace(uv)`, where the pixel is in its input frame (0..1 on each axis, the padded frame Pixi hands the
|
|
74368
|
+
* filter), and `sampleInput(n)`, the input read at such a place, inside the clamp. Both read `uInputClamp` only, never
|
|
74369
|
+
* the screen, so a member stays `"local"`; and the clamp is half a texel in from the frame in a live pass and from the
|
|
74370
|
+
* whole picture on the quad of stage 2 (`shade.ts`), so one body draws the same in both. A game's body does not get
|
|
74371
|
+
* them. Pure strings.
|
|
74372
|
+
*/
|
|
74373
|
+
/**
|
|
74374
|
+
* The WGSL head of every member: `inputPlace(uv)` and `sampleInput(n)` over the filter's input. `textureSampleLevel`,
|
|
74375
|
+
* so a member may read its input inside a branch.
|
|
74376
|
+
*/
|
|
74377
|
+
const SET_WGSL = `fn inputPlace(uv: vec2<f32>) -> vec2<f32> {
|
|
74378
|
+
return (uv - gfu.uInputClamp.xy) / (gfu.uInputClamp.zw - gfu.uInputClamp.xy);
|
|
74379
|
+
}
|
|
74380
|
+
|
|
74381
|
+
fn sampleInput(n: vec2<f32>) -> vec4<f32> {
|
|
74382
|
+
return textureSampleLevel(uTexture, uSampler, mix(gfu.uInputClamp.xy, gfu.uInputClamp.zw, clamp(n, vec2<f32>(0.0), vec2<f32>(1.0))), 0.0);
|
|
74383
|
+
}
|
|
74384
|
+
|
|
74385
|
+
`;
|
|
74386
|
+
/** The GLSL twin of `SET_WGSL`: the same two helpers over `uInputClamp` and `uTexture` of the GLSL header. */
|
|
74387
|
+
const SET_GLSL = `vec2 inputPlace(vec2 uv) {
|
|
74388
|
+
return (uv - uInputClamp.xy) / (uInputClamp.zw - uInputClamp.xy);
|
|
74389
|
+
}
|
|
74390
|
+
|
|
74391
|
+
vec4 sampleInput(vec2 n) {
|
|
74392
|
+
return textureLod(uTexture, mix(uInputClamp.xy, uInputClamp.zw, clamp(n, 0.0, 1.0)), 0.0);
|
|
74393
|
+
}
|
|
74394
|
+
|
|
74395
|
+
`;
|
|
74396
|
+
/**
|
|
74397
|
+
* A member's WGSL body with the set head before it. A call, so a bundle that drops the member drops the text too: a
|
|
74398
|
+
* concatenation at module scope would stay, its strings with it.
|
|
74399
|
+
*
|
|
74400
|
+
* @param body - The member's WGSL body.
|
|
74401
|
+
* @returns The head, then the body.
|
|
74402
|
+
* @example
|
|
74403
|
+
* ```ts
|
|
74404
|
+
* withSetWgsl("@fragment fn mainFragment").startsWith("fn inputPlace("); // true
|
|
74405
|
+
* ```
|
|
74406
|
+
*/
|
|
74407
|
+
function withSetWgsl(body) {
|
|
74408
|
+
return SET_WGSL + body;
|
|
74409
|
+
}
|
|
74410
|
+
/**
|
|
74411
|
+
* A member's GLSL body with the set head before it, for the same reason as `withSetWgsl`.
|
|
74412
|
+
*
|
|
74413
|
+
* @param body - The member's GLSL body.
|
|
74414
|
+
* @returns The head, then the body.
|
|
74415
|
+
* @example
|
|
74416
|
+
* ```ts
|
|
74417
|
+
* withSetGlsl("void main() {}").startsWith("vec2 inputPlace("); // true
|
|
74418
|
+
* ```
|
|
74419
|
+
*/
|
|
74420
|
+
function withSetGlsl(body) {
|
|
74421
|
+
return SET_GLSL + body;
|
|
74422
|
+
}
|
|
74423
|
+
/**
|
|
74424
|
+
* A view washed with `color` by `amount`: 0 draws the view as it is, 1 draws its shape in `color`, its alpha kept.
|
|
74425
|
+
* For a hit, a pick, a merge: tween `amount` up and down. List it in a feature's `filters`, as a game's own filter.
|
|
74426
|
+
* One render pass, one sample; on WebGPU a tween draws on the view's own quad, no pass, from its third frame.
|
|
74427
|
+
*
|
|
74428
|
+
* @example
|
|
74429
|
+
* ```ts
|
|
74430
|
+
* // features/board/feature.ts lists it: filters: [Flash]. A merged piece flashes gold, then a motion fades it out.
|
|
74431
|
+
* Flash({ amount: 1, color: 0xffd700 }).value; // { amount: 1, color: 0xffd700, enabled: true, order: 0 }
|
|
74432
|
+
* view.tween(Flash, { amount: 0 }, { ms: 160 });
|
|
74433
|
+
* ```
|
|
74434
|
+
*/
|
|
74435
|
+
const Flash = /*#__PURE__*/ defineFilter("effects.flash", {
|
|
74436
|
+
wgsl: /* @__PURE__ */ withSetWgsl(`@fragment
|
|
74437
|
+
fn mainFragment(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {
|
|
74438
|
+
let c = sampleInput(inputPlace(uv));
|
|
74439
|
+
|
|
74440
|
+
return mix(c, vec4<f32>(fu.color * c.a, c.a), clamp(fu.amount, 0.0, 1.0));
|
|
74441
|
+
}
|
|
74442
|
+
`),
|
|
74443
|
+
glsl: /* @__PURE__ */ withSetGlsl(`void main() {
|
|
74444
|
+
vec4 c = sampleInput(inputPlace(vTextureCoord));
|
|
74445
|
+
|
|
74446
|
+
finalColor = mix(c, vec4(color * c.a, c.a), clamp(amount, 0.0, 1.0));
|
|
74447
|
+
}
|
|
74448
|
+
`),
|
|
74449
|
+
uniforms: {
|
|
74450
|
+
amount: 0,
|
|
74451
|
+
color: { color: 16777215 }
|
|
74452
|
+
}
|
|
74453
|
+
});
|
|
74454
|
+
/**
|
|
74455
|
+
* A colour grade of a view: `contrast` about the middle grey, then `brightness`, then `saturation` against the luma,
|
|
74456
|
+
* then a multiply by `tint`. Each number is 1 for no change, 0..2; `saturation: 0` is grey. The alpha is kept. In place
|
|
74457
|
+
* of `ColorMatrix` where a value moves: on WebGPU a tween draws on the view's own quad, no pass, from its third frame.
|
|
74458
|
+
* List it in a feature's `filters`, as a game's own filter. One render pass, one sample.
|
|
74459
|
+
*
|
|
74460
|
+
* @example
|
|
74461
|
+
* ```ts
|
|
74462
|
+
* // A locked level card goes grey, and a kept picture holds it: a still view pays no pass.
|
|
74463
|
+
* Grade({ saturation: 0 }).value.saturation; // 0
|
|
74464
|
+
* Grade.filter.cache; // "local"
|
|
74465
|
+
* ```
|
|
74466
|
+
*/
|
|
74467
|
+
const Grade = /*#__PURE__*/ defineFilter("effects.grade", {
|
|
74468
|
+
wgsl: /* @__PURE__ */ withSetWgsl(`const GRADE_LUMA = vec3<f32>(0.2126, 0.7152, 0.0722);
|
|
74469
|
+
|
|
74470
|
+
@fragment
|
|
74471
|
+
fn mainFragment(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {
|
|
74472
|
+
let c = sampleInput(inputPlace(uv));
|
|
74473
|
+
var rgb = c.rgb / max(c.a, 1e-6);
|
|
74474
|
+
|
|
74475
|
+
rgb = (rgb - 0.5) * fu.contrast + 0.5;
|
|
74476
|
+
rgb = rgb * fu.brightness;
|
|
74477
|
+
rgb = mix(vec3<f32>(dot(rgb, GRADE_LUMA)), rgb, fu.saturation);
|
|
74478
|
+
rgb = clamp(rgb * fu.tint, vec3<f32>(0.0), vec3<f32>(1.0));
|
|
74479
|
+
|
|
74480
|
+
return vec4<f32>(rgb * c.a, c.a);
|
|
74481
|
+
}
|
|
74482
|
+
`),
|
|
74483
|
+
glsl: /* @__PURE__ */ withSetGlsl(`const vec3 GRADE_LUMA = vec3(0.2126, 0.7152, 0.0722);
|
|
74484
|
+
|
|
74485
|
+
void main() {
|
|
74486
|
+
vec4 c = sampleInput(inputPlace(vTextureCoord));
|
|
74487
|
+
vec3 rgb = c.rgb / max(c.a, 1e-6);
|
|
74488
|
+
|
|
74489
|
+
rgb = (rgb - 0.5) * contrast + 0.5;
|
|
74490
|
+
rgb = rgb * brightness;
|
|
74491
|
+
rgb = mix(vec3(dot(rgb, GRADE_LUMA)), rgb, saturation);
|
|
74492
|
+
rgb = clamp(rgb * tint, vec3(0.0), vec3(1.0));
|
|
74493
|
+
|
|
74494
|
+
finalColor = vec4(rgb * c.a, c.a);
|
|
74495
|
+
}
|
|
74496
|
+
`),
|
|
74497
|
+
uniforms: {
|
|
74498
|
+
brightness: 1,
|
|
74499
|
+
contrast: 1,
|
|
74500
|
+
saturation: 1,
|
|
74501
|
+
tint: { color: 16777215 }
|
|
74502
|
+
}
|
|
74503
|
+
});
|
|
74504
|
+
/**
|
|
74505
|
+
* A view darkened outside a disc: inside `radius` of the point `x`, `y` it is drawn as it is, from there over `soft` it
|
|
74506
|
+
* fades to `color`, by `amount`. The point and the lengths are in 0..1 of the view on each axis, so on a view twice as
|
|
74507
|
+
* wide as tall the disc is an ellipse. The alpha is kept. List it in a feature's `filters`, as a game's own filter. One
|
|
74508
|
+
* render pass, one sample; on WebGPU a tween draws on the view's own quad, no pass, from its third frame.
|
|
74509
|
+
*
|
|
74510
|
+
* @example
|
|
74511
|
+
* ```ts
|
|
74512
|
+
* // A dream scene closes in at the edges, then the vignette fades away as the player wakes.
|
|
74513
|
+
* Vignette({ radius: 0.3, soft: 0.4 }).value.amount; // 1
|
|
74514
|
+
* view.tween(Vignette, { amount: 0 }, { ms: 300 });
|
|
74515
|
+
* ```
|
|
74516
|
+
*/
|
|
74517
|
+
const Vignette = /*#__PURE__*/ defineFilter("effects.vignette", {
|
|
74518
|
+
wgsl: /* @__PURE__ */ withSetWgsl(`@fragment
|
|
74519
|
+
fn mainFragment(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {
|
|
74520
|
+
let n = inputPlace(uv);
|
|
74521
|
+
let c = sampleInput(n);
|
|
74522
|
+
let d = distance(n, vec2<f32>(fu.x, fu.y));
|
|
74523
|
+
let v = smoothstep(fu.radius, fu.radius + max(fu.soft, 1e-4), d) * clamp(fu.amount, 0.0, 1.0);
|
|
74524
|
+
|
|
74525
|
+
return vec4<f32>(mix(c.rgb, fu.color * c.a, v), c.a);
|
|
74526
|
+
}
|
|
74527
|
+
`),
|
|
74528
|
+
glsl: /* @__PURE__ */ withSetGlsl(`void main() {
|
|
74529
|
+
vec2 n = inputPlace(vTextureCoord);
|
|
74530
|
+
vec4 c = sampleInput(n);
|
|
74531
|
+
float d = distance(n, vec2(x, y));
|
|
74532
|
+
float v = smoothstep(radius, radius + max(soft, 1e-4), d) * clamp(amount, 0.0, 1.0);
|
|
74533
|
+
|
|
74534
|
+
finalColor = vec4(mix(c.rgb, color * c.a, v), c.a);
|
|
74535
|
+
}
|
|
74536
|
+
`),
|
|
74537
|
+
uniforms: {
|
|
74538
|
+
x: .5,
|
|
74539
|
+
y: .5,
|
|
74540
|
+
radius: .5,
|
|
74541
|
+
soft: .25,
|
|
74542
|
+
color: { color: 0 },
|
|
74543
|
+
amount: 1
|
|
74544
|
+
}
|
|
74545
|
+
});
|
|
74546
|
+
//#endregion
|
|
74302
74547
|
//#region src/index.ts
|
|
74303
74548
|
/**
|
|
74304
74549
|
* The `@moku-labs/game` package — 2D puzzle game engine on Moku Core.
|
|
@@ -74515,4 +74760,4 @@ const screen = [
|
|
|
74515
74760
|
uiPlugin
|
|
74516
74761
|
];
|
|
74517
74762
|
//#endregion
|
|
74518
|
-
export {
|
|
74763
|
+
export { play$1 as $, SHADER_WHATS as $t, types_exports$7 as A, Blur as At, types_exports$17 as B, assetsPlugin as Bt, types_exports as C, Traced as Ct, types_exports$4 as D, effectsPlugin as Dt, types_exports$3 as E, messageDuration as Et, types_exports$12 as F, Outline as Ft, platformPlugin as G, rendererPlugin as Gt, resolve as H, AnimPlayer as Ht, types_exports$13 as I, defineFilter as It, external as J, MONITOR_SECTIONS as Jt, HAPTIC_KINDS as K, PASS_KINDS as Kt, types_exports$14 as L, debugPlugin as Lt, types_exports$9 as M, Displacement as Mt, types_exports$10 as N, Glow as Nt, types_exports$5 as O, Emitter as Ot, types_exports$11 as P, Noise as Pt, parallel as Q, PROBLEM_RULES as Qt, types_exports$15 as R, audioPlugin as Rt, ready as S, Traceable as St, types_exports$2 as T, messageArgument as Tt, defineMotion as U, Animation as Ut, uiPlugin as V, animPlugin as Vt, textPlugin as W, Frames as Wt, haptic as X, PERF_GAP_BUCKETS as Xt, frames as Y, PERF_CAUSES as Yt, mark as Z, PERF_LOG_VERSION as Zt, flattenFeatures as _, Pressable as _t, Vignette as a, contribution as an, stagger as at, defineBundles as b, Tappable as bt, cubicBezier as c, to as cn, use as ct, hint as d, SaveUnreadableError as dn, Draggable as dt, CANVAS_RESTARTS as en, sequence as et, schedule as f, lifecyclePlugin as fn, DropTarget as ft, defineFeature as g, PointerOver as gt, tr as h, Pointer as ht, screen as i, refuseStart as in, spawned as it, types_exports$8 as j, ColorMatrix as jt, types_exports$6 as k, Alpha as kt, defineEffect as l, type as ln, wait as lt, defineScene as m, clockPlugin as mn, Hovered as mt, createPlugin as n, worldPlugin as nn, sfx as nt, Grade as o, exit as on, stopSfx as ot, projection as p, timePlugin as pn, Held as pt, defineAnimation as q, frameAt as qt, defineGame as r, flowPlugin as rn, spawn as rt, Flash as s, slot as sn, tween as st, createApp as t, DEMAND_REASONS as tn, set as tt, guide as u, modelPlugin as un, inputPlugin as ut, defineEmitter as v, Pressed as vt, types_exports$1 as w, i18nPlugin as wt, load as x, Touchable as xt, music as y, Swipeable as yt, types_exports$16 as z, scenesPlugin as zt };
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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-
|
|
3
|
-
import { b as memory, x as saveOf, y as WithGameState } from "./types-
|
|
2
|
+
import { t as createApp } from "./index-E62NqrO6.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-Ddezbux2.mjs";
|
|
4
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
|
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as flattenFeatures, in as refuseStart, ln as type, on as exit, t as createApp } from "./src-GFqUAdoU.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,7 +1,7 @@
|
|
|
1
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-
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-DeybZgVT.mjs";
|
|
3
3
|
import { H as I18nApi, J as TextKey, q as StringTable } from "./types-L3E-YS4N.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { Et as effectsPlugin, _t as platformPlugin, i as screen, kt as audioPlugin, t as createApp, yt as PlatformProvider } from "./index-E62NqrO6.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -2241,8 +2241,64 @@ type EmitterInstance = {
|
|
|
2241
2241
|
readonly space: "world" | "local"; /** Pixi's particle class, from the module the renderer loaded. */
|
|
2242
2242
|
readonly particleClass: PixiModule["Particle"];
|
|
2243
2243
|
};
|
|
2244
|
+
//#endregion
|
|
2245
|
+
//#region src/plugins/effects/set/types.d.ts
|
|
2246
|
+
/**
|
|
2247
|
+
* @file effects/set — the values of the members of the engine's effect set: one field per uniform, then `enabled` and
|
|
2248
|
+
* `order`, which every filter component carries. A number field is tweenable; a colour is a `0xrrggbb` number, set,
|
|
2249
|
+
* not tweened.
|
|
2250
|
+
*/
|
|
2251
|
+
/**
|
|
2252
|
+
* `Flash`: the view washed with `color` by `amount`, 0 none, 1 all of it.
|
|
2253
|
+
*
|
|
2254
|
+
* @example
|
|
2255
|
+
* ```ts
|
|
2256
|
+
* const value: FlashValue = { amount: 1, color: 0xffd700, enabled: true, order: 0 };
|
|
2257
|
+
* ```
|
|
2258
|
+
*/
|
|
2259
|
+
type FlashValue = {
|
|
2260
|
+
amount: number;
|
|
2261
|
+
color: number;
|
|
2262
|
+
enabled: boolean;
|
|
2263
|
+
order: number;
|
|
2264
|
+
};
|
|
2265
|
+
/**
|
|
2266
|
+
* `Grade`: contrast, brightness and saturation of the view, each 1 for none (0..2), then a multiply by `tint`.
|
|
2267
|
+
*
|
|
2268
|
+
* @example
|
|
2269
|
+
* ```ts
|
|
2270
|
+
* const value: GradeValue = { brightness: 1, contrast: 1, saturation: 0, tint: 0xffffff, enabled: true, order: 0 };
|
|
2271
|
+
* ```
|
|
2272
|
+
*/
|
|
2273
|
+
type GradeValue = {
|
|
2274
|
+
brightness: number;
|
|
2275
|
+
contrast: number;
|
|
2276
|
+
saturation: number;
|
|
2277
|
+
tint: number;
|
|
2278
|
+
enabled: boolean;
|
|
2279
|
+
order: number;
|
|
2280
|
+
};
|
|
2281
|
+
/**
|
|
2282
|
+
* `Vignette`: the view darkened, or coloured, outside a disc around `x`, `y` (0..1 of the view) of `radius`, over a soft
|
|
2283
|
+
* edge `soft` wide, by `amount`.
|
|
2284
|
+
*
|
|
2285
|
+
* @example
|
|
2286
|
+
* ```ts
|
|
2287
|
+
* const value: VignetteValue = { x: 0.5, y: 0.5, radius: 0.3, soft: 0.4, color: 0x000000, amount: 1, enabled: true, order: 0 };
|
|
2288
|
+
* ```
|
|
2289
|
+
*/
|
|
2290
|
+
type VignetteValue = {
|
|
2291
|
+
x: number;
|
|
2292
|
+
y: number;
|
|
2293
|
+
radius: number;
|
|
2294
|
+
soft: number;
|
|
2295
|
+
color: number;
|
|
2296
|
+
amount: number;
|
|
2297
|
+
enabled: boolean;
|
|
2298
|
+
order: number;
|
|
2299
|
+
};
|
|
2244
2300
|
declare namespace types_d_exports$2 {
|
|
2245
|
-
export { AlphaValue, AssetsReplaced$1 as AssetsReplaced, BlurValue, BundleUnloaded$1 as BundleUnloaded, ColorMatrixValue, Config$2 as Config, CoreKind, Curve, Deps$2 as Deps, DisplacementValue, EffectsApi, EffectsCtx, EffectsDiagnostics, EffectsStats, EmitterConfig, EmitterDefinition, EmitterValue, FilterArea, FilterCache, FilterChainContext, FilterComponent, FilterDefinition, FilterInput, FilterInputDefinition, FilterSpec, FilterStage, FilterStep, FilterValueOf, GlowValue, HotSwap, KernelSlice$2 as KernelSlice, NoiseValue, OutlineValue, Range, ResolvedEmitterConfig, Shape, State$2 as State, UniformDeclaration, UniformSpec, UniformValue };
|
|
2301
|
+
export { AlphaValue, AssetsReplaced$1 as AssetsReplaced, BlurValue, BundleUnloaded$1 as BundleUnloaded, ColorMatrixValue, Config$2 as Config, CoreKind, Curve, Deps$2 as Deps, DisplacementValue, EffectsApi, EffectsCtx, EffectsDiagnostics, EffectsStats, EmitterConfig, EmitterDefinition, EmitterValue, FilterArea, FilterCache, FilterChainContext, FilterComponent, FilterDefinition, FilterInput, FilterInputDefinition, FilterSpec, FilterStage, FilterStep, FilterValueOf, FlashValue, GlowValue, GradeValue, HotSwap, KernelSlice$2 as KernelSlice, NoiseValue, OutlineValue, Range, ResolvedEmitterConfig, Shape, State$2 as State, UniformDeclaration, UniformSpec, UniformValue, VignetteValue };
|
|
2246
2302
|
}
|
|
2247
2303
|
/**
|
|
2248
2304
|
* effects plugin config. `maxParticles` here is the global warning line; the `maxParticles` of an
|
|
@@ -3229,4 +3285,4 @@ type UiApi = {
|
|
|
3229
3285
|
}> | undefined;
|
|
3230
3286
|
};
|
|
3231
3287
|
//#endregion
|
|
3232
|
-
export {
|
|
3288
|
+
export { mark as $, FilterComponent as A, FramesValue as B, EmitterDefinition as C, ColorMatrixValue as D, BlurValue as E, OutlineValue as F, HapticKind as G, State$3 as H, UniformDeclaration as I, HAPTIC_KINDS as J, SfxDescriptor as K, AnimApi as L, FilterValueOf as M, GlowValue as N, DisplacementValue as O, NoiseValue as P, haptic as Q, AnimPlayerValue as R, EmitterConfig as S, AlphaValue as T, Target as U, MotionKeyframe as V, types_d_exports$3 as W, external as X, defineAnimation as Y, frames as Z, State$2 as _, AudioApi as a, spawn as at, GradeValue as b, MusicDescriptor as c, stopSfx as ct, State$1 as d, wait as dt, parallel as et, VolumesFor as f, OverlayApi as ft, EffectsStats as g, EffectsApi as h, types_d_exports as i, sfx as it, FilterSpec as j, FilterArea as k, MusicOptions as l, tween as lt, Config$2 as m, State as n, sequence as nt, AudioContextLike as o, spawned as ot, types_d_exports$1 as p, types_d_exports$4 as pt, Step as q, UiApi as r, set as rt, Config$1 as s, stagger as st, Config as t, play as tt, SoundEntry as u, use as ut, types_d_exports$2 as v, EmitterValue as w, VignetteValue as x, FlashValue as y, Config$3 as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
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 {
|
|
2
|
+
import { L as AnimApi, r as UiApi } from "./types-DeybZgVT.mjs";
|
|
3
3
|
import { L as InputApi } from "./types-L3E-YS4N.mjs";
|
|
4
4
|
import { r as Repro } from "./headless-Co3SEFi5.mjs";
|
|
5
5
|
import { i as ControlApp, o as InputOf } from "./types-BE6tcAFX.mjs";
|
|
6
|
-
import { t as commands } from "./commands-
|
|
6
|
+
import { t as commands } from "./commands-CnGF1AfS.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-BziiITWm.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
|
@@ -28,7 +28,7 @@ Root exports:
|
|
|
28
28
|
- Plugin instances: `timePlugin`, `lifecyclePlugin`, `modelPlugin`, `clockPlugin`, `flowPlugin`, `worldPlugin`, `rendererPlugin`, `inputPlugin`, `assetsPlugin`, `scenesPlugin`, `animPlugin`, `i18nPlugin`, `textPlugin`, `uiPlugin`, `audioPlugin`, `effectsPlugin`, `platformPlugin`; the list `screen` = `world`, `renderer`, `input`, `assets`, `scenes`, `anim`, `i18n`, `text`, `ui`. `effects`, `audio` and `platform` are opt-in: `plugins: [...screen, effectsPlugin, audioPlugin, platformPlugin]`, `platform` last.
|
|
29
29
|
- Screen helpers from the root: `component`, `tag`, `resource`, `mut`, `system`, `projection`, `Layer`, `Order`, `Exiting`, `Tree`, `Now`, `Transform`, `Sprite`, `NineSlice`, `Shape`, `Parent`, `Display`, `Overlay`, `HudPart`, `sprite`, `Tappable`, `Pressable`, `Draggable`, `DropTarget`, `Swipeable`, `Traceable`, `Touchable`, `Held`, `Hovered`, `PointerOver`, `Pressed`, `Pointer`, `Traced`, `defineBundles`, `load`, `defineScene`.
|
|
30
30
|
- Interface helpers from the root (V3): `defineAnimation`, `sequence`, `parallel`, `stagger`, `tween`, `set`, `wait`, `mark`, `frames`, `sfx`, `haptic`, `use`, `spawn`, `spawned`, `play`, `external`, `defineMotion`, `Animation`, `Frames`, the resource `AnimPlayer`; `tr`, `messageArgument`, `messageDuration`; `Text`, `label`, `defineTextStyles`, `defineTextFormats`, `bind`, `Countdown` and the types `BindOptions`, `CountdownValue`, `TextFormat`, `TextFormats`, `TextFormatAnswer`, `TextFormatFunction`, `FormattedNumber`; `defineComponent`, `popup`, `defineStyle`, `defineTokens`, `resolve`, `Box`, `LocalWrite`, `DebugTrigger`, `ScrollState`; `music`. Also `stopSfx(id, { fadeMs? })` (ends a named sound, see audio) and `cubicBezier(x1, y1, x2, y2)` (a CSS-style easing curve for `tween`'s `ease`).
|
|
31
|
-
- Effects helpers from the root (V5): `defineEmitter`, `Emitter`, `defineFilter`, `Glow`, `Outline`, `Blur`, `ColorMatrix`, `Noise`, `Displacement`, `Alpha`.
|
|
31
|
+
- Effects helpers from the root (V5): `defineEmitter`, `Emitter`, `defineFilter`, `Glow`, `Outline`, `Blur`, `ColorMatrix`, `Noise`, `Displacement`, `Alpha`; the effect set `Flash`, `Grade`, `Vignette` and their value types `FlashValue`, `GradeValue`, `VignetteValue`.
|
|
32
32
|
- Platform from the root (V6): the types `PlatformProvider`, `BackResult`, `HapticKind` and the frozen list `HAPTIC_KINDS`.
|
|
33
33
|
- `defineGame<Types>()` returns, typed by the game's `player`, `session`, `assets`, `bundles`, `scenes`, `strings`, `textStyles` and `textFormats`: `defineNode`, `defineFlow`, `defineFeature`, `projection`, `sprite`, `Sprite`, `NineSlice`, `defineBundles`, `load`, `defineScene`, `defineAnimation`, `frames`, `sfx`, `play`, `tr`, `label`, `bind`, `defineTextStyles`, `defineTextFormats`, `defineComponent`, `defineStyle`, `defineTokens`, `popup`, `music`, `Frames`, `defineEmitter`, `Emitter`, `Displacement`, and `system` (its `ctx.snapshot` typed by `player` and `session`), `volumes` (the `audio` config's reader of the typed player), `key` (string keys from data, below). `Types` is `{ player; session; assets: string; bundles?: string; scenes?: string; strings: Record<string, unknown>; textStyles?: string; textFormats?: string; emitters?: string }`.
|
|
34
34
|
- `@moku-labs/game/assets`: `scanAssets(options)`, `emitKeys`, `emitManifest`, `compileStrings(root, out, options?)`, `checkStrings`, `packAssets(options)`, `exportStrings`, `importStrings`, `runCli(argv, strings)` with `strings: StringsTools` = `{ compile: compileStrings, exportStrings, importStrings }`. Audio files are `.mp3` or `.m4a`. Asset key = feature (or layer name) + "." + path inside `assets/`; a sub-feature's own name, `features/episodes/ep01/assets/ward/room.png` → `ep01.ward.room`. `runCli` (a game's `bun run assets:keys`) scans the assets and compiles the `strings/<locale>.json` of every feature and sub-feature, and the `strings/` of every layer, into `generated/strings.ts` (the `Strings` type for `defineGame`), one `generated/strings.<locale>.ts` per locale for the top-level features and the layers, and `generated/strings.<feature>.<locale>.ts` per sub-feature with string files, its keys only, each starting with `<feature>.` (it imports `messageArgument` and `messageDuration` from `@moku-labs/game` when a message needs them, no helper is copied in); `--check` fails when any output is out of date; `--pack <dir>` writes the production build. `--layer <folder>[=<name>]`, repeatable and good with every mode, scans `<root>/<folder>/` like one more feature under `<name>` (`<folder>` alone maps to itself): its `assets.ts`, `assets/` and `strings/<locale>.json`. A game on the layered layout passes `--layer shared=ui`, so `shared/assets/*` keeps the `ui.*` keys. A missing layer folder is a warning. `scanAssets`, `compileStrings`, `exportStrings` and `importStrings` take the same map as `layers: { shared: "ui" }`. `--pseudo` also writes the pseudo-locale `en-XA`. `--export <dir>` and `--import <dir>` exchange strings with translators; `--source <locale>` names the locale they read from, `"en"` by default. The package bin `moku-game-assets` is this CLI: a script is `"assets:keys": "moku-game-assets --root src --manifest public/assets/manifest.json --keys src/generated/assets.ts"`. A game with `config.ts` runs `moku-game keys` and `moku-game pack` instead: they pass its paths and its layers.
|
|
@@ -676,6 +676,7 @@ Cosmetic rendering extras as data, drawn by `effectsPlugin`: `plugins: [...scree
|
|
|
676
676
|
- Filter inputs: `inputs: { blur: { stages: [FrostBox4, FrostGauss], chain: (value, { resolution }) => [{ stage, scale, uniforms? }] } }` gives the body `sampleBlur(uv)` in both languages: the last texture of a chain of stages (each a `defineFilter`, drawing alone) drawn from the view's input into pooled textures at `resolution × scale`. The chain runs only when a uniform or the resolution changed; a step naming a stage not in `stages` breaks the filter. The engine counts the passes (leave `passes` out). `fallback: OtherFilter` (a subset of the uniforms) draws when the filter is broken.
|
|
677
677
|
- Shader checks run in every build: every body, stage and fallback compiles once on the device when the renderer first draws, and the first scene mounts after the checks (`effects:mount-waited`). A broken filter (`effects:broken` with reason `compile`, `apply` or `chain`) draws its fallback or the view unfiltered, never a blank frame; a dev build also draws magenta stripes over it.
|
|
678
678
|
- Built-in filters: `Glow`, `Outline`, `Blur`, `ColorMatrix`, `Noise`, `Displacement` (`map` is an asset key), `Alpha`. A motion hook tweens them like any component: `view.tween(Glow, { strength: 0 }, { ms: 200 })`.
|
|
679
|
+
- The effect set: ready filters a feature lists in `filters`, as a game's own (`filters: [Flash]`; two features may list the same one): `Flash({ amount: 0..1, color })` washes the view with a colour, `Grade({ brightness, contrast, saturation, tint })` grades it (each 1 for none, 0..2), `Vignette({ x, y, radius, soft, color, amount })` darkens it outside a disc in 0..1 of the view. Each is one pass and one sample, `cache: "local"`, and on WebGPU a tween draws on the view's own quad from its third frame: `view.tween(Flash, { amount: 0 }, { ms: 160 })`. A view that carries a filter no feature lists draws unfiltered; a dev build warns `effects:filter-unlisted` once per id.
|
|
679
680
|
- API: `app.effects.stats()` returns `{ particles, emitters, filters, renderPasses }`; headless every number is 0.
|
|
680
681
|
- `app.effects.diagnostics`: `kinds()` (built-ins, then feature filters, after start), `disable(kind)`, `enable(kind)`, `disabled()` (the off kinds in registration order). A switch acts on a dev or agent page only and answers `false` elsewhere or for an unknown kind (`effects:diagnostics-unknown`, once per id); an off kind keeps its instances and is left out of what the renderer draws from the next frame (`stats().filters` stays, `renderPasses` drops); a switch logs `effects:diagnostics` and writes a `switch` event to the performance log.
|
|
681
682
|
- Config: `maxParticles: 3000` and `maxPasses: 24`, each warns once per crossing; `phone: "auto"`; `blur: { quality: 2, phoneResolution: 0.5 }`.
|