From 8c0a4b12544a474447f678a2482612c162fd17b5 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 3 Apr 2017 17:47:11 -1000 Subject: [PATCH] * --- README.md | 17 +---------------- presets/template.rabbits.rin | 5 +++++ scripts/core/ronin.js | 2 +- scripts/modules/source.js | 2 +- scripts/modules/terminal.js | 3 +++ 5 files changed, 11 insertions(+), 18 deletions(-) create mode 100644 presets/template.rabbits.rin diff --git a/README.md b/README.md index 8067e1a..0835838 100644 --- a/README.md +++ b/README.md @@ -34,19 +34,4 @@ Enjoy Load .rin files, instead of "Presets" Load default.rin on startup * Eye - Swatches, handle all colors - - this.collection["custom"] = {}; - this.collection["custom"]["default"] = "@ 720x405 ; / ../assets/todo.jpg 720x 0,0 ; % chromatic 2 ; / ../assets/logo.png 35x35 15,355"; - this.collection["custom"]["black"] = "@ 720x405 #ff0000 ; / ../assets/todo.jpg 720x 0,-30 ; % grey ; % sharpen ; % sharpen ; % chromatic 2 ; @ layer=icon ; / ../assets/logo.png 35x35 15,355 "; - - this.collection["photo"] = {}; - this.collection["photo"]["black"] = "@ 720x405 #ff0000 ; / ../assets/todo.jpg 720x 0,-30 ; % sharpen 0.2 ; % chromatic 2 ; % grey"; - - this.collection["brush"] = {}; - this.collection["brush"]["radial6"] = "> 600,400 60';> 600,400 120';> 600,400 180';> 600,400 240';> 600,400 300'"; - this.collection["brush"]["radial8"] = "> 600,400 45';> 600,400 90';> 600,400 135';> 600,400 180';> 600,400 225';> 600,400 270';> 600,400 315'"; - - this.collection["vector"] = {}; - this.collection["vector"]["ronin"] = "+ M150,53 A-96,97 0 0,0 246,150 M150,246 A97,-96 0 0,0 53,150 M53,101 A-48,-48 0 0,0 101,53 M246,101 A48,-48 0 0,1 198,53 M53,198 A-48,48 0 0,1 101,246 M246,198 A48,48 0 0,0 198,246 stroke_width=45 line_cap=square stroke_color=black"; - this.collection["vector"]["circle"] = "+ M 100, 100 m -75, 0 a 75,75 0 1,0 150,0 a 75,75 0 1,0 -150,0"; + Swatches, handle all colors \ No newline at end of file diff --git a/presets/template.rabbits.rin b/presets/template.rabbits.rin new file mode 100644 index 0000000..4b7962b --- /dev/null +++ b/presets/template.rabbits.rin @@ -0,0 +1,5 @@ +terminal.display hide ; +frame.resize 720x405 ; +source.load /01.jpg 720x 0,0 ; +render.sharpen 0.5 ; +source.load /hundred.rabbits.logo.white.svg 50x50 0,355 ; \ No newline at end of file diff --git a/scripts/core/ronin.js b/scripts/core/ronin.js index b150348..cf3c954 100644 --- a/scripts/core/ronin.js +++ b/scripts/core/ronin.js @@ -27,7 +27,7 @@ function Ronin() this.modules[this.brush.constructor.name] = this.brush; this.modules[this.source.constructor.name] = this.source; - // this.modules[this.render.constructor.name] = this.render; + this.modules[this.render.constructor.name] = this.render; // this.modules[this.eye.constructor.name] = this.eye; // this.modules[this.magnet.constructor.name] = this.magnet; diff --git a/scripts/modules/source.js b/scripts/modules/source.js index 31690fa..159e791 100644 --- a/scripts/modules/source.js +++ b/scripts/modules/source.js @@ -21,7 +21,7 @@ function Source(rune) ronin.overlay.draw_rect(params.position(),params.rect()); base_image = new Image(); - base_image.src = params.filepath().path; + base_image.src = "../assets/"+params.filepath().path; base_image.src += '?'+new Date().getTime(); base_image.crossOrigin = "Anonymous"; diff --git a/scripts/modules/terminal.js b/scripts/modules/terminal.js index 12e3b90..7aba9fb 100644 --- a/scripts/modules/terminal.js +++ b/scripts/modules/terminal.js @@ -99,6 +99,9 @@ function Terminal(rune) else if(ronin[module_name] && ronin[module_name].settings[setting_name]){ ronin[module_name].update_setting(setting_name,parameters); } + else if(ronin["render"].collection[method_name]){ + ronin["render"].collection[method_name].render(parameters); + } else if(ronin[module_name]){ ronin.terminal.log(new Log(ronin.terminal,"Unknown method: "+method_name)); }