From 2ae737c5b5e27f5421c5bf1913b30f584e3840d9 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 16 Nov 2016 10:34:37 -0800 Subject: [PATCH] Added vector tool. --- index.html | 3 ++- scripts/commander.js | 7 +++++++ scripts/ronin.js | 1 + scripts/ronin.vector.js | 21 +++++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 scripts/ronin.vector.js diff --git a/index.html b/index.html index d421102..63f3508 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,7 @@ + @@ -26,7 +27,7 @@
-
Hey
+
diff --git a/scripts/commander.js b/scripts/commander.js index 4968688..69e0ea2 100644 --- a/scripts/commander.js +++ b/scripts/commander.js @@ -53,6 +53,9 @@ function Commander(element,element_input) case ":": ronin.filter.active(cmd); break; + case "+": + ronin.vector.active(cmd); + break; } this.hide(); @@ -96,6 +99,10 @@ function Commander(element,element_input) ronin.filter.passive(this.cmd); ronin.module = ronin.filter; break; + case "+": + ronin.vector.passive(this.cmd); + ronin.module = ronin.vector; + break; } } } \ No newline at end of file diff --git a/scripts/ronin.js b/scripts/ronin.js index 26a3346..9cca5d8 100644 --- a/scripts/ronin.js +++ b/scripts/ronin.js @@ -7,4 +7,5 @@ function Ronin() this.hint = new Hint(); this.filter = new Filter(); this.stroke = new Stroke(); + this.vector = new Vector(); } \ No newline at end of file diff --git a/scripts/ronin.vector.js b/scripts/ronin.vector.js new file mode 100644 index 0000000..5a07fb9 --- /dev/null +++ b/scripts/ronin.vector.js @@ -0,0 +1,21 @@ +function Vector() +{ + Module.call(this); + + // Module + + this.passive = function(cmd) + { + } + + this.active = function(cmd) + { + var path = new Path2D('M 100,100 h 50 v 50 h 50'); + ronin.canvas.context().stroke(path); + } + + this.hint = function(cmd) + { + return "Vector: " + } +} \ No newline at end of file