mudlet-map-renderer 0.29.2-konva → 0.30.0-konva
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/backend/BlueprintBackend.d.ts +3 -1
- package/dist/backend/DrawingBackend.d.ts +15 -0
- package/dist/backend/IsometricBackend.d.ts +3 -12
- package/dist/backend/KonvaBackend.d.ts +3 -1
- package/dist/backend/NeonBackend.d.ts +3 -1
- package/dist/backend/ParchmentBackend.d.ts +3 -1
- package/dist/backend/SketchyBackend.d.ts +3 -1
- package/dist/backend/SvgBackend.d.ts +3 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +354 -327
- package/dist/index.mjs.map +1 -1
- package/dist/rendering/KonvaRenderBackend.d.ts +9 -12
- package/dist/rendering/MapRenderer.d.ts +3 -10
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DrawingBackend, GroupNode, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
1
|
+
import { DrawingBackend, GroupNode, CoordFn, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator that wraps a DrawingBackend and remaps all colors to a
|
|
4
4
|
* technical blueprint aesthetic (white lines on deep blue).
|
|
@@ -31,4 +31,6 @@ export declare class BlueprintBackend implements DrawingBackend {
|
|
|
31
31
|
x: number;
|
|
32
32
|
y: number;
|
|
33
33
|
};
|
|
34
|
+
getTransform(): CoordFn;
|
|
35
|
+
getInverseTransform(): CoordFn;
|
|
34
36
|
}
|
|
@@ -89,6 +89,12 @@ export interface ImageConfig {
|
|
|
89
89
|
* When set, x/y/width/height describe the source rect; the matrix positions the output. */
|
|
90
90
|
transform?: [number, number, number, number, number, number];
|
|
91
91
|
}
|
|
92
|
+
/** Forward/inverse 2D coordinate transform, used by backends that warp map space (e.g. isometric). */
|
|
93
|
+
export type CoordFn = (x: number, y: number) => {
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
};
|
|
97
|
+
export declare const IDENTITY_TRANSFORM: CoordFn;
|
|
92
98
|
export interface DrawingBackend {
|
|
93
99
|
createGroup(x: number, y: number): GroupNode;
|
|
94
100
|
addRect(parent: GroupNode, config: RectConfig): void;
|
|
@@ -105,4 +111,13 @@ export interface DrawingBackend {
|
|
|
105
111
|
x: number;
|
|
106
112
|
y: number;
|
|
107
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* Map-space → render-space transform. Identity for flat backends; non-identity
|
|
116
|
+
* for backends that warp coordinates (e.g. {@link IsometricBackend}).
|
|
117
|
+
* Decorators delegate to their inner backend.
|
|
118
|
+
* MapRenderer auto-applies this to culling and grid rendering when the backend is set.
|
|
119
|
+
*/
|
|
120
|
+
getTransform(): CoordFn;
|
|
121
|
+
/** Inverse of {@link getTransform}. */
|
|
122
|
+
getInverseTransform(): CoordFn;
|
|
108
123
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DrawingBackend, GroupNode, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
1
|
+
import { DrawingBackend, GroupNode, CoordFn, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
2
2
|
/**
|
|
3
3
|
* Rotation angle in degrees for the isometric view.
|
|
4
4
|
* Any number is accepted. Common presets:
|
|
@@ -62,17 +62,8 @@ export declare class IsometricBackend implements DrawingBackend {
|
|
|
62
62
|
private isoAffine;
|
|
63
63
|
addText(parent: GroupNode, config: TextConfig): void;
|
|
64
64
|
addImage(parent: GroupNode, config: ImageConfig): void;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*/
|
|
68
|
-
getTransform(): (x: number, y: number) => {
|
|
69
|
-
x: number;
|
|
70
|
-
y: number;
|
|
71
|
-
};
|
|
72
|
-
getInverseTransform(): (x: number, y: number) => {
|
|
73
|
-
x: number;
|
|
74
|
-
y: number;
|
|
75
|
-
};
|
|
65
|
+
getTransform(): CoordFn;
|
|
66
|
+
getInverseTransform(): CoordFn;
|
|
76
67
|
getExitDepthOffset(): {
|
|
77
68
|
x: number;
|
|
78
69
|
y: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as Konva } from 'konva';
|
|
2
|
-
import { DrawingBackend, GroupNode, LayerNode, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
2
|
+
import { DrawingBackend, GroupNode, LayerNode, CoordFn, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
3
3
|
/**
|
|
4
4
|
* Wraps a Konva.Group as a GroupNode.
|
|
5
5
|
*/
|
|
@@ -38,4 +38,6 @@ export declare class KonvaBackend implements DrawingBackend {
|
|
|
38
38
|
x: number;
|
|
39
39
|
y: number;
|
|
40
40
|
};
|
|
41
|
+
getTransform(): CoordFn;
|
|
42
|
+
getInverseTransform(): CoordFn;
|
|
41
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DrawingBackend, GroupNode, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
1
|
+
import { DrawingBackend, GroupNode, CoordFn, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator that wraps a DrawingBackend and remaps all colors to a
|
|
4
4
|
* cyberpunk/neon aesthetic — glowing colored outlines on a dark background.
|
|
@@ -29,4 +29,6 @@ export declare class NeonBackend implements DrawingBackend {
|
|
|
29
29
|
x: number;
|
|
30
30
|
y: number;
|
|
31
31
|
};
|
|
32
|
+
getTransform(): CoordFn;
|
|
33
|
+
getInverseTransform(): CoordFn;
|
|
32
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DrawingBackend, GroupNode, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
1
|
+
import { DrawingBackend, GroupNode, CoordFn, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator that wraps a DrawingBackend and remaps all colors to a
|
|
4
4
|
* warm sepia / old-parchment palette.
|
|
@@ -44,4 +44,6 @@ export declare class ParchmentBackend implements DrawingBackend {
|
|
|
44
44
|
x: number;
|
|
45
45
|
y: number;
|
|
46
46
|
};
|
|
47
|
+
getTransform(): CoordFn;
|
|
48
|
+
getInverseTransform(): CoordFn;
|
|
47
49
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DrawingBackend, GroupNode, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
1
|
+
import { DrawingBackend, GroupNode, CoordFn, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator that wraps a DrawingBackend and applies hand-drawn "pencil" wobble
|
|
4
4
|
* to all shapes. Text and images pass through unchanged.
|
|
@@ -37,4 +37,6 @@ export declare class SketchyBackend implements DrawingBackend {
|
|
|
37
37
|
x: number;
|
|
38
38
|
y: number;
|
|
39
39
|
};
|
|
40
|
+
getTransform(): CoordFn;
|
|
41
|
+
getInverseTransform(): CoordFn;
|
|
40
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DrawingBackend, GroupNode, LayerNode, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
1
|
+
import { DrawingBackend, GroupNode, LayerNode, CoordFn, RectConfig, CircleConfig, LineConfig, PolygonConfig, TextConfig, ImageConfig } from './DrawingBackend';
|
|
2
2
|
/**
|
|
3
3
|
* SVG implementation of GroupNode.
|
|
4
4
|
* Accumulates SVG element strings at a given (x, y) offset.
|
|
@@ -47,4 +47,6 @@ export declare class SvgBackend implements DrawingBackend {
|
|
|
47
47
|
x: number;
|
|
48
48
|
y: number;
|
|
49
49
|
};
|
|
50
|
+
getTransform(): CoordFn;
|
|
51
|
+
getInverseTransform(): CoordFn;
|
|
50
52
|
}
|