@simpludify/web 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/asset-loaders.d.ts +6 -0
- package/dist/assets.d.ts +158 -0
- package/dist/audio.d.ts +97 -0
- package/dist/canvas-visual.d.ts +2 -0
- package/dist/game.d.ts +32 -4
- package/dist/geometry-tilemap-visual.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1530 -245
- package/dist/index.js.map +1 -1
- package/dist/pointer.d.ts +7 -5
- package/dist/renderer.d.ts +7 -2
- package/dist/shared-images.d.ts +9 -2
- package/dist/tilemap-visual.d.ts +3 -3
- package/package.json +2 -2
package/dist/pointer.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { InputSystem, PointerInfo } from "@simpludify/core";
|
|
2
2
|
import { PointerRouting, type ViewTransform, type WorldPoint } from "@simpludify/core";
|
|
3
|
+
interface PointerProjection {
|
|
4
|
+
screen: PointerInfo["screen"];
|
|
5
|
+
world: WorldPoint;
|
|
6
|
+
view: ViewTransform;
|
|
7
|
+
}
|
|
3
8
|
/** One DOM capture-phase adapter per Game; Pixi federated events never route these widgets. */
|
|
4
9
|
export declare class BrowserPointer {
|
|
5
10
|
private readonly host;
|
|
@@ -17,11 +22,7 @@ export declare class BrowserPointer {
|
|
|
17
22
|
constructor(host: HTMLElement, project: (event: {
|
|
18
23
|
clientX: number;
|
|
19
24
|
clientY: number;
|
|
20
|
-
}) =>
|
|
21
|
-
screen: PointerInfo["screen"];
|
|
22
|
-
world: WorldPoint;
|
|
23
|
-
view: ViewTransform;
|
|
24
|
-
}, report: (error: unknown) => void, flush: () => void, input?: InputSystem | undefined);
|
|
25
|
+
}) => PointerProjection | undefined, report: (error: unknown) => void, flush: () => void, input?: InputSystem | undefined);
|
|
25
26
|
private applyMouse;
|
|
26
27
|
private releaseMouse;
|
|
27
28
|
private updateMouse;
|
|
@@ -32,3 +33,4 @@ export declare class BrowserPointer {
|
|
|
32
33
|
release(): void;
|
|
33
34
|
dispose(): void;
|
|
34
35
|
}
|
|
36
|
+
export {};
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { CanvasUI, PointerRouting, VirtualInput } from "@simpludify/core";
|
|
2
2
|
import { type PreparedScene, type RendererPort, type Scene } from "@simpludify/core";
|
|
3
|
+
import { type AssetStore } from "./assets.js";
|
|
3
4
|
import { type CanvasPresentation } from "./canvas-visual.js";
|
|
5
|
+
import type { SharedImages } from "./shared-images.js";
|
|
4
6
|
import { type VirtualInputPresentation } from "./virtual-input-visual.js";
|
|
5
7
|
export declare class PixiRenderer implements RendererPort {
|
|
6
8
|
private readonly host;
|
|
7
9
|
private readonly background;
|
|
8
10
|
private readonly onError;
|
|
11
|
+
private readonly assetServices?;
|
|
9
12
|
private readonly app;
|
|
10
13
|
private readonly pendingUITextKeys;
|
|
11
14
|
private readonly canvasPresentations;
|
|
@@ -50,7 +53,6 @@ export declare class PixiRenderer implements RendererPort {
|
|
|
50
53
|
private ready;
|
|
51
54
|
private dead;
|
|
52
55
|
private visualCount;
|
|
53
|
-
private textureCount;
|
|
54
56
|
get diagnostics(): {
|
|
55
57
|
imageReferences: number;
|
|
56
58
|
imageEntries: number;
|
|
@@ -59,7 +61,10 @@ export declare class PixiRenderer implements RendererPort {
|
|
|
59
61
|
visuals: number;
|
|
60
62
|
textures: number;
|
|
61
63
|
};
|
|
62
|
-
constructor(host: HTMLElement, background?: string, onError?: (error: unknown) => void
|
|
64
|
+
constructor(host: HTMLElement, background?: string, onError?: (error: unknown) => void, assetServices?: {
|
|
65
|
+
store: AssetStore;
|
|
66
|
+
images: SharedImages;
|
|
67
|
+
} | undefined);
|
|
63
68
|
init(): Promise<void>;
|
|
64
69
|
private image;
|
|
65
70
|
private acquireImage;
|
package/dist/shared-images.d.ts
CHANGED
|
@@ -7,19 +7,26 @@ export interface ImageResource {
|
|
|
7
7
|
}
|
|
8
8
|
export interface ImageLease extends ImageResource {
|
|
9
9
|
textureFor(frame?: SpriteFrame): Texture;
|
|
10
|
+
useFrames?(frames: () => Iterable<SpriteFrame>): void;
|
|
11
|
+
onChange?(listener: () => void): () => void;
|
|
10
12
|
}
|
|
11
13
|
/** Renderer-local, live-reference cache. No idle retention or process-global state. */
|
|
12
14
|
export declare class SharedImages {
|
|
13
15
|
private readonly load;
|
|
14
16
|
private readonly entries;
|
|
17
|
+
private loaded;
|
|
15
18
|
private references;
|
|
16
19
|
private dead;
|
|
17
|
-
constructor(load: (url: string, signal: AbortSignal) => Promise<ImageResource>);
|
|
20
|
+
constructor(load: (url: string, signal: AbortSignal, mode?: "explicit" | "reload") => Promise<ImageResource>);
|
|
18
21
|
get diagnostics(): {
|
|
19
22
|
imageReferences: number;
|
|
20
23
|
imageEntries: number;
|
|
21
24
|
pendingImages: number;
|
|
22
25
|
};
|
|
23
|
-
|
|
26
|
+
get textures(): number;
|
|
27
|
+
acquire(key: string | symbol, signal: AbortSignal, request?: {
|
|
28
|
+
url: string;
|
|
29
|
+
mode: "explicit" | "reload";
|
|
30
|
+
}): Promise<ImageLease>;
|
|
24
31
|
dispose(): void;
|
|
25
32
|
}
|
package/dist/tilemap-visual.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Tilemap, type ViewTransform } from "@simpludify/core";
|
|
2
2
|
import { Container, Sprite } from "pixi.js";
|
|
3
3
|
import type { ImageLease } from "./shared-images.js";
|
|
4
4
|
/** Renderer-owned sparse visible set; sheet pixels are owned by SharedImages. */
|
|
@@ -29,11 +29,11 @@ export declare class TilemapVisual {
|
|
|
29
29
|
private invalid;
|
|
30
30
|
private readonly off;
|
|
31
31
|
private readonly offDispose;
|
|
32
|
-
constructor(map: Tilemap<string>,
|
|
32
|
+
constructor(map: Tilemap<string>, isCurrent: () => boolean, acquire: (url: string, signal: AbortSignal) => Promise<ImageLease>, changed: () => void, onError: (error: unknown) => void, released: () => void);
|
|
33
33
|
private fail;
|
|
34
34
|
sync(): void;
|
|
35
35
|
private remove;
|
|
36
36
|
private cell;
|
|
37
|
-
render(view: ViewTransform): void;
|
|
37
|
+
render(view: ViewTransform, enabled?: boolean): void;
|
|
38
38
|
dispose(): void;
|
|
39
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simpludify/web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@simpludify/core": "0.
|
|
17
|
+
"@simpludify/core": "0.2.0",
|
|
18
18
|
"pixi.js": "8.22.0"
|
|
19
19
|
},
|
|
20
20
|
"description": "Browser host, PixiJS rendering and input for the experimental Simpludify 2D engine.",
|