mudlet-map-renderer 2.1.0 → 2.3.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 +42 -0
- package/dist/{MapReader-mU_4JWv_.js → MapReader-Brzg-X7T.js} +1 -1
- package/dist/{MapReader-mU_4JWv_.js.map → MapReader-Brzg-X7T.js.map} +1 -1
- package/dist/assets/worker-DtQws85m.js.map +1 -0
- package/dist/binary.mjs +1 -1
- package/dist/export/flushSceneShapes.d.ts +1 -1
- package/dist/flushSceneShapes-Duhi0OQv.js +2937 -0
- package/dist/flushSceneShapes-Duhi0OQv.js.map +1 -0
- package/dist/hit/HitTester.d.ts +19 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +2534 -4696
- package/dist/index.mjs.map +1 -1
- package/dist/labelPlacement.d.ts +132 -0
- package/dist/offscreen.mjs +355 -0
- package/dist/offscreen.mjs.map +1 -0
- package/dist/overlay/RippleEffect.d.ts +48 -0
- package/dist/overlay/SceneOverlay.d.ts +16 -3
- package/dist/rendering/KonvaRenderBackend.d.ts +4 -0
- package/dist/rendering/MapRenderer.d.ts +12 -3
- package/dist/rendering/offscreen/OffscreenCanvasBackend.d.ts +109 -0
- package/dist/rendering/offscreen/index.d.ts +11 -0
- package/dist/rendering/offscreen/protocol.d.ts +100 -0
- package/dist/rendering/offscreen/renderFrame.d.ts +28 -0
- package/dist/rendering/offscreen/serializeTransform.d.ts +20 -0
- package/dist/rendering/offscreen/worker.d.ts +15 -0
- package/dist/style/Style.d.ts +12 -0
- package/dist/style/index.d.ts +24 -1
- package/dist/style/shape/DarkModernStyle.d.ts +15 -0
- package/dist/style/shape/GraphPaperStyle.d.ts +16 -0
- package/dist/style/shape/StainedGlassStyle.d.ts +15 -0
- package/dist/style/shape/TopographicStyle.d.ts +14 -0
- package/dist/style/shape/TreasureMapStyle.d.ts +23 -0
- package/dist/style/shape/WatercolorStyle.d.ts +32 -0
- package/dist/style/shape/index.d.ts +7 -0
- package/dist/style/shape/paintMap.d.ts +8 -0
- package/package.json +6 -1
package/dist/hit/HitTester.d.ts
CHANGED
|
@@ -3,6 +3,15 @@ export type CoordTransform = (x: number, y: number) => {
|
|
|
3
3
|
x: number;
|
|
4
4
|
y: number;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Extra scene-space offset applied to a layer's geometry, mirroring a
|
|
8
|
+
* render-time per-layer shift the {@link CoordTransform} does not capture
|
|
9
|
+
* (e.g. Isometric lowers the `link` layer by the cube depth).
|
|
10
|
+
*/
|
|
11
|
+
export type LayerOffset = (layer: Shape["layer"]) => {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
6
15
|
/** Result returned by {@link HitTester.pick} et al. */
|
|
7
16
|
export interface HitResult {
|
|
8
17
|
kind: string;
|
|
@@ -47,14 +56,17 @@ export declare class HitTester {
|
|
|
47
56
|
private roomSize;
|
|
48
57
|
private spatialIndex;
|
|
49
58
|
private transform;
|
|
59
|
+
private layerOffset;
|
|
50
60
|
/**
|
|
51
61
|
* Rebuild from a fresh set of world-space shapes.
|
|
52
62
|
*
|
|
53
63
|
* @param shapes Top-level shape list from {@link ScenePipeline}.
|
|
54
64
|
* @param roomSize Current room size (world units) — used as base pick margin.
|
|
55
65
|
* @param coordTransform World→rendered projection; omit for flat (identity).
|
|
66
|
+
* @param layerOffset Per-layer scene-space shift the projection omits
|
|
67
|
+
* (e.g. Isometric link-layer depth); omit for none.
|
|
56
68
|
*/
|
|
57
|
-
build(shapes: Shape[], roomSize: number, coordTransform?: CoordTransform): void;
|
|
69
|
+
build(shapes: Shape[], roomSize: number, coordTransform?: CoordTransform, layerOffset?: LayerOffset): void;
|
|
58
70
|
clear(): void;
|
|
59
71
|
/**
|
|
60
72
|
* Find the best-matching hittable shape at a rendered-space point.
|
|
@@ -87,6 +99,12 @@ export declare class HitTester {
|
|
|
87
99
|
private forEachCandidate;
|
|
88
100
|
private toResult;
|
|
89
101
|
private collectHitShapes;
|
|
102
|
+
/**
|
|
103
|
+
* Transform for one entry: the base projection plus any per-layer scene
|
|
104
|
+
* offset the projection omits (e.g. Isometric link-layer depth), so hit
|
|
105
|
+
* geometry lands where the shape is actually drawn.
|
|
106
|
+
*/
|
|
107
|
+
private entryTransform;
|
|
90
108
|
private indexEntry;
|
|
91
109
|
}
|
|
92
110
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ export type { CameraTransform } from './draw/DrawCommandBuilder';
|
|
|
25
25
|
export { svgFromBatches } from './render/SvgRenderer';
|
|
26
26
|
export { renderToCanvas } from './render/CanvasRenderer';
|
|
27
27
|
export type { ImageFactory, CanvasRenderOptions } from './render/CanvasRenderer';
|
|
28
|
-
export { Parchment, Blueprint, Neon, Sketchy, Isometric, Construction, SciFi, GradientRooms, compose, identityStyle, applyStyleToShapes, } from './style';
|
|
29
|
-
export type { Style, StyleContext, SketchyOptions, IsometricOptions, IsometricRotation, GradientRoomsOptions, } from './style';
|
|
28
|
+
export { Parchment, Blueprint, Neon, Sketchy, Isometric, Construction, SciFi, GradientRooms, StainedGlass, GraphPaper, Topographic, Watercolor, DarkModern, TreasureMap, treasureMapDecorations, compose, identityStyle, applyStyleToShapes, } from './style';
|
|
29
|
+
export type { Style, StyleContext, SketchyOptions, IsometricOptions, IsometricRotation, GradientRoomsOptions, WatercolorOptions, } from './style';
|
|
30
30
|
export type { Exporter, ExportContext, ExportCanvas } from './export/Exporter';
|
|
31
31
|
export { SvgExporter } from './export/SvgExporter';
|
|
32
32
|
export { PngExporter, PngBlobExporter } from './export/PngExporter';
|
|
@@ -38,6 +38,10 @@ export type { SceneOverlay, SceneOverlayContext } from './overlay/SceneOverlay';
|
|
|
38
38
|
export type { LiveEffect, CoordinateTransform } from './overlay/LiveEffect';
|
|
39
39
|
export { AmbientLightOverlay } from './overlay/AmbientLightOverlay';
|
|
40
40
|
export type { AmbientLightOptions } from './overlay/AmbientLightOverlay';
|
|
41
|
+
export { RippleEffect } from './overlay/RippleEffect';
|
|
42
|
+
export type { RippleOptions } from './overlay/RippleEffect';
|
|
43
|
+
export { placeLabels } from './labelPlacement';
|
|
44
|
+
export type { Direction8, Rect, Obstacle, LabelPlacementItem, PlacedLabel, PlaceLabelsOptions, SlotScore, } from './labelPlacement';
|
|
41
45
|
export { default as MapReader } from './reader/MapReader';
|
|
42
46
|
export type { IMapReader } from './reader/MapReader';
|
|
43
47
|
export { default as PathFinder } from './PathFinder';
|