diff --git a/README.md b/README.md index 2e40f46..f035f06 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ Ronin is a simple open-source graphic design tool. ## Modules ## brush + +Missing documentation. + ### Settings - `size`, default 4 - `color`, default #000 @@ -19,14 +22,10 @@ Ronin is a simple open-source graphic design tool. - `->green->` **(0/255)** The brush color value(green). - `->blue->` **(0/255)** The brush color value(blue). -## eraser -### Settings - -### Methods - -### Ports - ## frame + +Missing documentation. + ### Settings - `width`, default 930 - `height`, default 540 @@ -39,6 +38,9 @@ Ronin is a simple open-source graphic design tool. ### Ports ## line + +Missing documentation. + ### Settings ### Methods @@ -49,6 +51,45 @@ Ronin is a simple open-source graphic design tool. - `step->` **(0/100)** The tween line index.. - `->thickness->` **(4/100)** The tween line thickness.. +## io + +Missing documentation. + +### Settings +- `anchor`, default [object Object] + +### Methods +- `import:`, no details. +- `load:`, no details. +- `save:`, no details. + +### Ports + +## path + +Missing documentation. + +### Settings + +### Methods +- `stroke:`, no details. +- `fill:`, no details. + +### Ports + +## magnet + +Cursor magnetisation settings. + +### Settings +- `size`, default 15 +- `rate`, default 4 + +### Methods +- `lock:`, no details. + +### Ports + ## License See the [LICENSE](LICENSE.md) file for license rights and limitations (CC). diff --git a/sources/index.html b/sources/index.html index 1c6bcfc..97c29c2 100644 --- a/sources/index.html +++ b/sources/index.html @@ -1,26 +1,27 @@
- - - + + + - + - - - - - - - + + + + + + + + diff --git a/sources/scripts/commander.js b/sources/scripts/core/commander.js similarity index 100% rename from sources/scripts/commander.js rename to sources/scripts/core/commander.js diff --git a/sources/scripts/cursor.js b/sources/scripts/core/cursor.js similarity index 100% rename from sources/scripts/cursor.js rename to sources/scripts/core/cursor.js diff --git a/sources/scripts/docs.js b/sources/scripts/core/docs.js similarity index 96% rename from sources/scripts/docs.js rename to sources/scripts/core/docs.js index ee3f5d9..0417b38 100644 --- a/sources/scripts/docs.js +++ b/sources/scripts/core/docs.js @@ -34,7 +34,8 @@ function Docs() for(module_name in modules){ var module = modules[module_name]; - html += "## "+module_name+"\n"; + html += "## "+module_name+"\n\n"; + html += module.docs+"\n\n"; html += this.print_settings(module.settings)+"\n"; html += this.print_methods(module.methods)+"\n"; html += this.print_ports(module.ports)+"\n"; diff --git a/sources/scripts/hint.js b/sources/scripts/core/hint.js similarity index 100% rename from sources/scripts/hint.js rename to sources/scripts/core/hint.js diff --git a/sources/scripts/keyboard.js b/sources/scripts/core/keyboard.js similarity index 81% rename from sources/scripts/keyboard.js rename to sources/scripts/core/keyboard.js index a2458d0..b2f1faf 100644 --- a/sources/scripts/keyboard.js +++ b/sources/scripts/core/keyboard.js @@ -33,6 +33,16 @@ function Keyboard() ronin.render.clear(); } + if(e.key == "o" && (e.ctrlKey || e.metaKey)){ + e.preventDefault(); + ronin.io.load(); + } + + if(e.key == "s" && (e.ctrlKey || e.metaKey)){ + e.preventDefault(); + ronin.io.save(); + } + if(e.key == "r" && (e.ctrlKey || e.metaKey)){ e.preventDefault(); ronin.io.render(); diff --git a/sources/scripts/layer.js b/sources/scripts/core/layer.js similarity index 100% rename from sources/scripts/layer.js rename to sources/scripts/core/layer.js diff --git a/sources/scripts/module.js b/sources/scripts/core/module.js similarity index 87% rename from sources/scripts/module.js rename to sources/scripts/core/module.js index 429dae8..c175fb8 100644 --- a/sources/scripts/module.js +++ b/sources/scripts/core/module.js @@ -1,10 +1,11 @@ -function Module(name) +function Module(name,docs = "Missing documentation.") { this.name = name; this.methods = {}; this.settings = {}; this.routes = {}; this.ports = {}; + this.docs = docs; this.hint = function() { diff --git a/sources/scripts/port.js b/sources/scripts/core/port.js similarity index 100% rename from sources/scripts/port.js rename to sources/scripts/core/port.js diff --git a/sources/scripts/query.js b/sources/scripts/core/query.js similarity index 100% rename from sources/scripts/query.js rename to sources/scripts/core/query.js diff --git a/sources/scripts/modules/io.js b/sources/scripts/modules/io.js index 156b437..b5e366b 100644 --- a/sources/scripts/modules/io.js +++ b/sources/scripts/modules/io.js @@ -24,6 +24,16 @@ function IO() }); } + this.methods.load = function(q) + { + // TODO + } + + this.methods.save = function(q) + { + // TODO + } + this.render = function() { var fs = require('fs'); diff --git a/sources/scripts/modules/magnet.js b/sources/scripts/modules/magnet.js new file mode 100644 index 0000000..72df318 --- /dev/null +++ b/sources/scripts/modules/magnet.js @@ -0,0 +1,11 @@ +function Magnet() +{ + Module.call(this,"magnet","Cursor magnetisation settings."); + + this.settings = {size:15,rate:4}; + + this.methods.lock = function() + { + + } +} \ No newline at end of file diff --git a/sources/scripts/modules/path.js b/sources/scripts/modules/path.js index 34a280b..71cd9e3 100644 --- a/sources/scripts/modules/path.js +++ b/sources/scripts/modules/path.js @@ -1,4 +1,14 @@ function Path() { Module.call(this,"path"); + + this.methods.stroke = function() + { + + } + + this.methods.fill = function() + { + + } } \ No newline at end of file diff --git a/sources/scripts/ronin.js b/sources/scripts/ronin.js index abaae71..523eba8 100644 --- a/sources/scripts/ronin.js +++ b/sources/scripts/ronin.js @@ -18,6 +18,8 @@ function Ronin() this.eraser = new Eraser(); this.frame = new Frame(); this.line = new Line(); + this.path = new Path(); + this.magnet = new Magnet(); this.layers = { grid : this.grid, @@ -30,6 +32,8 @@ function Ronin() frame : this.frame, line : this.line, io : this.io, + path : this.path, + magnet : this.magnet }; this.install = function() diff --git a/sources/scripts/units/rect.js b/sources/scripts/units/rect.js deleted file mode 100644 index 3e60396..0000000 --- a/sources/scripts/units/rect.js +++ /dev/null @@ -1,4 +0,0 @@ -function Rect(rect_str) -{ - -} \ No newline at end of file