@moku-labs/game 0.15.143 → 0.15.145
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-D6LmjgQc.mjs → assets-Cw-dwgD4.mjs} +377 -147
- package/dist/assets.d.mts +9 -7
- package/dist/assets.mjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/{commands-DLHoLKme.d.mts → commands-7RWSJMv7.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-Yco7v9wv.d.mts → define-DK_J6R4D.d.mts} +2 -2
- package/dist/{headless-Def8N-1F.d.mts → headless-BcgzSec_.d.mts} +1 -1
- package/dist/{index-bracik73.d.mts → index-BFbScS-y.d.mts} +3 -3
- 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-BMasjfv7.d.mts → runtime-RVZfCuNw.d.mts} +1 -1
- package/dist/{src-Dq7gGhN4.mjs → src-BR2Uw9Xz.mjs} +185 -23
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-Bj1uc5Qt.d.mts → types-BDCkyWXq.d.mts} +2 -2
- package/dist/{types-Dp8LeQTw.d.mts → types-C2hkiREP.d.mts} +2 -2
- package/dist/{types-DY1ck0TP.d.mts → types-DVNJ6JUa.d.mts} +4 -4
- package/dist/{types-BFoRyZqu.d.mts → types-NOciAl87.d.mts} +58 -11
- package/dist/{types-CwQ1ySw5.d.mts → types-rsz4pIqe.d.mts} +1 -1
- package/dist/{visual-CfI3T3Am.d.mts → visual-xIubQ2dq.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/package.json +1 -1
|
@@ -11728,16 +11728,29 @@ type CreateTextureOptions$1 = {
|
|
|
11728
11728
|
* Where `textures.slice` cuts a texture out of an atlas page, in page pixels. The manifest `atlas`
|
|
11729
11729
|
* field of `assets` carries it with the page id next to it, and passes as it is.
|
|
11730
11730
|
*
|
|
11731
|
+
* A frame cropped to its visible pixels at pack time also says where the crop lies in the original
|
|
11732
|
+
* image: `offsetX` and `offsetY` are the crop's first column and row inside the original,
|
|
11733
|
+
* `origWidth` and `origHeight` the original's size. All four together or none; an incomplete set
|
|
11734
|
+
* counts as none, and none means the frame is the whole image.
|
|
11735
|
+
*
|
|
11731
11736
|
* @example
|
|
11732
11737
|
* ```ts
|
|
11733
11738
|
* const frame: SliceFrame = { x: 583, y: 595, width: 256, height: 128 };
|
|
11739
|
+
* // A 300 x 200 image packed without its transparent margin: 256 x 128 of it, from column 9 and row 9.
|
|
11740
|
+
* const trimmed: SliceFrame = {
|
|
11741
|
+
* x: 583, y: 595, width: 256, height: 128, offsetX: 9, offsetY: 9, origWidth: 300, origHeight: 200
|
|
11742
|
+
* };
|
|
11734
11743
|
* ```
|
|
11735
11744
|
*/
|
|
11736
11745
|
type SliceFrame = {
|
|
11737
|
-
x: number;
|
|
11738
|
-
y: number;
|
|
11739
|
-
width: number;
|
|
11740
|
-
height: number;
|
|
11746
|
+
/** Column of the frame's first pixel on the page. */x: number; /** Row of the frame's first pixel on the page. */
|
|
11747
|
+
y: number; /** Width of the frame on the page, in pixels. */
|
|
11748
|
+
width: number; /** Height of the frame on the page, in pixels. */
|
|
11749
|
+
height: number; /** Column of the frame's first pixel inside the original image, for a trimmed frame. */
|
|
11750
|
+
offsetX?: number; /** Row of the frame's first pixel inside the original image, for a trimmed frame. */
|
|
11751
|
+
offsetY?: number; /** Width of the original image, for a trimmed frame. */
|
|
11752
|
+
origWidth?: number; /** Height of the original image, for a trimmed frame. */
|
|
11753
|
+
origHeight?: number;
|
|
11741
11754
|
};
|
|
11742
11755
|
/**
|
|
11743
11756
|
* The texture registry `assets` drives, `app.renderer.sync.textures`. The renderer makes and
|
|
@@ -11791,15 +11804,19 @@ type TexturesApi = {
|
|
|
11791
11804
|
/**
|
|
11792
11805
|
* Cuts a texture out of an atlas page, so `assets` never imports Pixi. The slice shares the
|
|
11793
11806
|
* page's source: no pixel is copied, and the page keeps the GPU memory. A frame is measured
|
|
11794
|
-
* from the page's own frame, so a slice of a slice lands where it should.
|
|
11807
|
+
* from the page's own frame, so a slice of a slice lands where it should. A trimmed frame (one
|
|
11808
|
+
* with `offsetX`, `offsetY`, `origWidth` and `origHeight`) keeps its original size: the slice
|
|
11809
|
+
* answers `width` and `height` of the original, and Pixi draws the cropped pixels at the offset,
|
|
11810
|
+
* so a sprite keeps its size and place.
|
|
11795
11811
|
*
|
|
11796
11812
|
* @param page - The page texture `create` made.
|
|
11797
|
-
* @param frame - The frame in page pixels
|
|
11813
|
+
* @param frame - The frame in page pixels; with the four trim fields, also where it lies in its
|
|
11814
|
+
* original image.
|
|
11798
11815
|
* @param options - `nine` is left, top, right and bottom in pixels; it becomes the slice's
|
|
11799
11816
|
* default nine-slice borders.
|
|
11800
11817
|
* @returns The slice. `destroy` frees only this wrapper, never the page's source.
|
|
11801
11818
|
* @throws {Error} When the renderer does not draw, and when the frame does not fit in the page
|
|
11802
|
-
* (a manifest packed for other pages).
|
|
11819
|
+
* (a manifest packed for other pages) or a trimmed frame does not fit in its original.
|
|
11803
11820
|
* @example
|
|
11804
11821
|
* ```ts
|
|
11805
11822
|
* // `assets`: the page "ui/main-0" landed; the packed button texture is cut out of it with its borders.
|
|
@@ -11808,6 +11825,13 @@ type TexturesApi = {
|
|
|
11808
11825
|
* button.width; // 256
|
|
11809
11826
|
* button.defaultBorders; // { left: 24, top: 24, right: 24, bottom: 24 }
|
|
11810
11827
|
* renderer.sync.textures.destroy(button); // the wrapper goes, the page's source stays
|
|
11828
|
+
*
|
|
11829
|
+
* // A 300 x 200 leaf packed without its transparent margin: 256 x 128 of it lie on the page.
|
|
11830
|
+
* const leaf = renderer.sync.textures.slice(page, {
|
|
11831
|
+
* x: 0, y: 0, width: 256, height: 128, offsetX: 9, offsetY: 9, origWidth: 300, origHeight: 200
|
|
11832
|
+
* });
|
|
11833
|
+
* leaf.width; // 300
|
|
11834
|
+
* leaf.trim; // Rectangle { x: 9, y: 9, width: 256, height: 128 }
|
|
11811
11835
|
* ```
|
|
11812
11836
|
*/
|
|
11813
11837
|
slice(page: PixiTexture, frame: SliceFrame, options?: CreateTextureOptions$1): PixiTexture;
|
|
@@ -14164,7 +14188,9 @@ type AssetsIo = {
|
|
|
14164
14188
|
* `atlas` frame is passed as it is.
|
|
14165
14189
|
*
|
|
14166
14190
|
* @param page - The page texture, made by `createTexture`.
|
|
14167
|
-
* @param frame - Where the file lies on the page, in page pixels.
|
|
14191
|
+
* @param frame - Where the file lies on the page, in page pixels. A trimmed file's frame also
|
|
14192
|
+
* carries `offsetX`, `offsetY`, `origWidth` and `origHeight`: the slice then answers the size of
|
|
14193
|
+
* the original and draws the cut at its offset.
|
|
14168
14194
|
* @param options - `nine` becomes the default nine-slice borders of the slice.
|
|
14169
14195
|
* @returns The new texture over the page's source.
|
|
14170
14196
|
*/
|
|
@@ -14194,12 +14220,29 @@ type NineSlice = {
|
|
|
14194
14220
|
};
|
|
14195
14221
|
/**
|
|
14196
14222
|
* Where a packed file lies: `page` is the id of a page of the same bundle, never a file name, and
|
|
14197
|
-
* the frame is in page pixels. `width` and `height` equal the file's own,
|
|
14198
|
-
* valid as it is.
|
|
14223
|
+
* the frame is in page pixels. Without the trim fields `width` and `height` equal the file's own,
|
|
14224
|
+
* so its `nine` stays valid as it is. With them the file was trimmed to its visible pixels: the
|
|
14225
|
+
* frame is the cut, `offsetX` and `offsetY` say where the cut's first column and row lay in the
|
|
14226
|
+
* original image, and `origWidth` and `origHeight` are the size of that original (the file's own
|
|
14227
|
+
* `width` and `height`). All four are there together or none is; a texture with `nine` is never
|
|
14228
|
+
* trimmed. The packer writes it; the loader cuts the file out of the page.
|
|
14199
14229
|
*
|
|
14200
14230
|
* @example
|
|
14201
14231
|
* ```ts
|
|
14202
14232
|
* const frame: AtlasFrame = { page: "ui/main-0", x: 583, y: 595, width: 256, height: 128 };
|
|
14233
|
+
*
|
|
14234
|
+
* // A 300×200 icon trimmed to its visible 256×128, which started at (20, 36) of the original.
|
|
14235
|
+
* const trimmed: AtlasFrame = {
|
|
14236
|
+
* page: "ui/main-0",
|
|
14237
|
+
* x: 583,
|
|
14238
|
+
* y: 595,
|
|
14239
|
+
* width: 256,
|
|
14240
|
+
* height: 128,
|
|
14241
|
+
* offsetX: 20,
|
|
14242
|
+
* offsetY: 36,
|
|
14243
|
+
* origWidth: 300,
|
|
14244
|
+
* origHeight: 200
|
|
14245
|
+
* };
|
|
14203
14246
|
* ```
|
|
14204
14247
|
*/
|
|
14205
14248
|
type AtlasFrame = {
|
|
@@ -14207,7 +14250,11 @@ type AtlasFrame = {
|
|
|
14207
14250
|
x: number;
|
|
14208
14251
|
y: number;
|
|
14209
14252
|
width: number;
|
|
14210
|
-
height: number;
|
|
14253
|
+
height: number; /** x of the frame's first column inside the original image. */
|
|
14254
|
+
offsetX?: number; /** y of the frame's first row inside the original image. */
|
|
14255
|
+
offsetY?: number; /** Width of the original image (the file's own `width`). */
|
|
14256
|
+
origWidth?: number; /** Height of the original image (the file's own `height`). */
|
|
14257
|
+
origHeight?: number;
|
|
14211
14258
|
};
|
|
14212
14259
|
/**
|
|
14213
14260
|
* One atlas page of a packed bundle. `id` is `<bundle>/<group>-<index>`, the name an `atlas`
|
|
@@ -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-NOciAl87.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";
|
|
@@ -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 { W 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-NOciAl87.mjs";
|
|
2
|
+
import { W as AnimApi, r as UiApi } from "./types-BDCkyWXq.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-rsz4pIqe.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-BcgzSec_.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-C2hkiREP.mjs";
|
|
6
|
+
import { t as commands } from "./commands-7RWSJMv7.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-xIubQ2dq.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 };
|