mudlet-map-renderer 0.0.5 → 0.0.8
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/.prettierrc +0 -0
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/exports.js +0 -0
- package/map-fragment/draw/controls.js +0 -5
- package/map-fragment/draw/renderer.js +17 -15
- package/map-fragment/reader/Area.js +0 -0
- package/map-fragment/reader/MapReader.js +0 -0
- package/package.json +2 -2
package/.prettierrc
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ const roomId = 1;
|
|
|
32
32
|
const scale = 40;
|
|
33
33
|
let area = reader.getAreaByRoomId(roomId);
|
|
34
34
|
let settings = { scale: scale}
|
|
35
|
-
let
|
|
35
|
+
let renderer = new Renderer(null, reader, area, reader.getColors(), settings);
|
|
36
36
|
fs.writeFileSync("mapFull.svg", renderer.exportSvg());
|
|
37
37
|
fs.writeFileSync("mapFragment.svg", renderer.exportSvg(roomId, 10));
|
|
38
38
|
console.log("Map generated");
|
package/exports.js
CHANGED
|
File without changes
|
|
@@ -74,11 +74,6 @@ class Controls {
|
|
|
74
74
|
toolPan.activate();
|
|
75
75
|
toolPan.onMouseDrag = (event) => {
|
|
76
76
|
this.element.style.cursor = "all-scroll";
|
|
77
|
-
let bounds = this.renderer.getBounds();
|
|
78
|
-
let viewBounds = this.view.getBounds();
|
|
79
|
-
if (viewBounds.x < bounds.x) {
|
|
80
|
-
this.view.translate(delta);
|
|
81
|
-
}
|
|
82
77
|
let delta = event.downPoint.subtract(event.point);
|
|
83
78
|
this.view.translate(delta.negate());
|
|
84
79
|
this.isDrag = true;
|
|
@@ -5,24 +5,26 @@ const Controls = require("./controls").Controls;
|
|
|
5
5
|
const padding = 7;
|
|
6
6
|
const gridSize = 20;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const Colors = {
|
|
9
|
+
OPEN_DOOR : new paper.Color(10 / 255, 155 / 255, 10 / 255),
|
|
10
|
+
CLOSED_DOOR : new paper.Color(226 / 255, 205 / 255, 59 / 255),
|
|
11
|
+
LOCKED_DOOR : new paper.Color(155 / 255, 10 / 255, 10 / 255)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
class Settings {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
this.isRound = false;
|
|
17
|
+
this.scale = 55;
|
|
18
|
+
this.roomSize = 10;
|
|
19
|
+
this.exitsSize = 2;
|
|
20
|
+
this.borders = false;
|
|
21
|
+
this.frameMode = false;
|
|
22
|
+
this.areaName = true;
|
|
23
|
+
this.showLabels = true;
|
|
24
|
+
this.uniformLevelSize = false;
|
|
25
|
+
this.fontFamily = 'sans-serif';
|
|
26
|
+
this.mapBackground = "#000000";
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
paper.Item.prototype.registerClick = function (callback) {
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED