summaryrefslogtreecommitdiff
path: root/tools/makeborders.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-11-12 14:34:56 +0100
committerTor Andersson <tor@ccxvii.net>2023-11-12 17:39:46 +0100
commit0cee28075504d3354e5c327200d472c760452b94 (patch)
treed4c87746e5365e553ded624bd4c7500f0607372a /tools/makeborders.js
parent9323f62100b1f74ac5361b86cc53655adaee9572 (diff)
downloadrichard-iii-0cee28075504d3354e5c327200d472c760452b94.tar.gz
Show border limits.
Diffstat (limited to 'tools/makeborders.js')
-rw-r--r--tools/makeborders.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/makeborders.js b/tools/makeborders.js
new file mode 100644
index 0000000..2dfdbd5
--- /dev/null
+++ b/tools/makeborders.js
@@ -0,0 +1,29 @@
+const print = console.log
+
+const data = require("../data.js")
+
+var w = 1688
+var h = 1950
+var m = "../map75.png"
+
+print(`<?xml version="1.0" encoding="UTF-8"?>
+<svg
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="${w}"
+ height="${h}"
+>
+<image xlink:href="${m}" x="0" y="0" width="${w}" height="${h}" image-rendering="pixelated" sodipodi:insensitive="true" />`)
+
+for (let id in data.BORDERS) {
+ let a = (id / 100) | 0
+ let b = id % 100
+ let x = (data.AREAS[a].layout.x + data.AREAS[b].layout.x) >> 1
+ let y = (data.AREAS[a].layout.y + data.AREAS[b].layout.y) >> 1
+ let label = data.AREAS[a].name + " / " + data.AREAS[b].name
+ print(`<circle inkscape:label="${label}" cx="${x}" cy="${y}" r="12"/>`)
+}
+
+print(`</svg>`)