diff --git a/presets/glyph.rin b/presets/glyph.rin index 296c978..2b3fafa 100644 --- a/presets/glyph.rin +++ b/presets/glyph.rin @@ -1,5 +1,13 @@ frame.resize 300x300 -layer.fill #A1A1A1 +~ layer.fill #A1A1A1 brush:color #ff0000 +path:line_width 10 magnet.grid 15x15 4,4 -frame.select work \ No newline at end of file +frame.select work +~ OQUONIE +path.stroke M45,60 l210,0 M45,240 l210,0 M255,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M75,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M255,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M75,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M60,75 l0,150 M240,75 l0,150 M60,150 l180,0 +~ THOUSAND ROOMS +~ path.stroke M45,60 l210,0 M45,240 l210,0 M255,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M75,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M255,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M75,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M240,75 l0,150 M60,75 l0,150 M180,60 l0,180 M60,180 l180,0 M195,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M165,240 a15,-15 0 0,0 15,-15 a15,15 0 0,0 15,15 +~ DONSOL +~ path.stroke M150,60 l-90,90 l90,90 l90,-90 l-90,-90 +source.save \ No newline at end of file diff --git a/presets/itch.rin b/presets/itch.rin new file mode 100644 index 0000000..9b5403a --- /dev/null +++ b/presets/itch.rin @@ -0,0 +1,10 @@ +frame.resize 315x250 +layer.fill #111 +magnet:color #999 +magnet.grid 15x15 3,4 +path:line_color #ffffff +path:line_width 5 +path:line_cap square +path:fill_color #fff +source.load /badge.donsol.png 82.5,45 150x +source.save diff --git a/scripts/modules/magnet.js b/scripts/modules/magnet.js index ed1b0bb..3c1e664 100644 --- a/scripts/modules/magnet.js +++ b/scripts/modules/magnet.js @@ -3,7 +3,7 @@ function Magnet(rune) Module.call(this,rune); this.size = new Rect("1x1"); - this.rate = null; + this.rate = new Position("4,4"); this.add_setting(new Setting("color","#000000")); @@ -20,7 +20,7 @@ function Magnet(rune) if(preview == false){ if(cmd.rect()){ this.size = cmd.rect(); } - if(cmd.position()){ this.rate = cmd.rect(); } + if(cmd.position()){ this.rate = cmd.position(); } } return 1, preview ? "preview" : "ok"; @@ -38,29 +38,17 @@ function Magnet(rune) var horizontal = ronin.frame.size.width/rect.width; var vertical = ronin.frame.size.height/rect.height; - + for (var x = 1; x < horizontal; x++) { for (var y = 1; y < vertical; y++) { var dot_position = new Position(x * rect.width, y * rect.height); var size = 0.5; - if(position && x % position.x == 0 && y % position.y == 0){ size = 1; } + if(this.rate && x % this.rate.x == 0 && y % this.rate.y == 0){ size = 1; } this.draw_marker(dot_position,size); } } } - this.draw_helper = function(position) - { - if(this.size.width < 5 || this.size.height < 5){ return; } - - var magnetized = this.magnetic_position(position); - this.context().beginPath(); - this.context().arc(magnetized.x, magnetized.y, 4, 0, 2 * Math.PI, false); - this.context().strokeStyle = this.settings["color"].value; - this.context().stroke(); - this.context().closePath(); - } - this.draw_marker = function(position,size = 0.5) { this.context().beginPath(); @@ -83,7 +71,6 @@ function Magnet(rune) if(this.size.width > 4 || this.size.height > 4){ if(!this.layer){ this.create_layer(); } this.layer.clear(); - this.draw_helper(position); this.draw_grid(this.size,this.rate); }