aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-10-14 13:17:21 +1200
committerDevine Lu Linvega <[email protected]>2018-10-14 13:17:21 +1200
commit467aa1471a40671c343ba41c3c41d67f3b1ad72e (patch)
tree07ee2f5144e5815b7b91e771e07e1e687714730f
parent4c3b76172ec718dfb72737438a72cd94c1596ac9 (diff)
downloadOrca-467aa1471a40671c343ba41c3c41d67f3b1ad72e.tar.gz
Orca-467aa1471a40671c343ba41c3c41d67f3b1ad72e.zip
resize grid on load
-rw-r--r--cli/terminal.js1
-rw-r--r--core/pico.js2
-rw-r--r--examples/wires.pico40
3 files changed, 23 insertions, 20 deletions
diff --git a/cli/terminal.js b/cli/terminal.js
index ece8bdc..4f19f59 100644
--- a/cli/terminal.js
+++ b/cli/terminal.js
@@ -85,6 +85,7 @@ function Terminal(pico)
const h = data.split("\n").length
terminal.log(`Loaded: ${path} ${w}x${h}`)
pico.load(w,h,data)
+ terminal._grid.width = w
terminal.update()
});
}
diff --git a/core/pico.js b/core/pico.js
index 4091b6f..84c32ca 100644
--- a/core/pico.js
+++ b/core/pico.js
@@ -90,6 +90,8 @@ function Pico (w, h) {
}
this.load = function (w, h, s) {
+
+ console.log(w,h)
this.w = w // Width
this.h = h // Height
this.reset()
diff --git a/examples/wires.pico b/examples/wires.pico
index c4e44f4..4a06db6 100644
--- a/examples/wires.pico
+++ b/examples/wires.pico
@@ -1,20 +1,20 @@
-........................................
-.....s...........s......................
-........................................
-.....*---*...*---*...*---*...*---*.w....
-.....|...|...|...|...|...|...|...|......
-.....|...|...|...|...|...|...|...|......
-.....*---*...*---*...*---*...*---*......
-........................................
-..e..*---*...*---*...*---*...*---*......
-.....|...|...|...|...|...|...|...|......
-.....|...|...|...|...|...|...|...|......
-.....*---*...*---*...*---*...*---*.w....
-........................................
-.....*---*...*---*...*---*...*---*......
-.....|...|...|...|...|...|...|...|......
-.....|...|...|...|...|...|...|...|......
-..e..*---*...*---*...*---*...*---*......
-........................................
-.....................n...........n......
-........................................ \ No newline at end of file
+..............................
+.....s.......s................
+..............................
+.....*--*.*--*.*--*.*--*.w....
+.....|..|.|..|.|..|.|..|......
+.....|..|.|..|.|..|.|..|......
+.....*--*.*--*.*--*.*--*......
+..............................
+...e.*--*.*--*.*--*-*--*......
+.....|..|.|..|.|..|.|..|......
+.....|..|.|..|.|..|.|..|......
+.....*--*.*--*.*--*.*--*.w....
+..............................
+.....*--*.*--*.*--*.*--*......
+.....|..|.|..|.|..|.|..|......
+.....|..|.|..|.|..|.|..|......
+...e.*--*.*--*.*--*.*--*......
+..............................
+...............n.......n......
+.............................. \ No newline at end of file