Removed old render()
This commit is contained in:
parent
b59abbd3bc
commit
5d8d7cadb5
@ -2,3 +2,7 @@ frame.resize 500x500
|
||||
layer.fill #eeeeee
|
||||
brush:color #333333
|
||||
brush:size 3
|
||||
frame.select main
|
||||
brush.add 1,1
|
||||
brush.add 2,2
|
||||
brush.add 3,3
|
@ -1,19 +1,17 @@
|
||||
frame.resize 300x300
|
||||
frame.select background
|
||||
layer.fill #eeeeee
|
||||
frame.select stencil
|
||||
render.stencil 45' #cccccc
|
||||
frame.resize 300x320
|
||||
layer.fill #000000
|
||||
path:line_width 28
|
||||
path:line_cap butt
|
||||
magnet.grid 15x15 4,4
|
||||
frame.select logo
|
||||
path:line_width 43
|
||||
path:line_color #000000
|
||||
path:line_cap square
|
||||
path.stroke M105,240 a-45,-45 0 0,0 -45,-45 M150,240 a-90,-90 0 0,0 -90,-90 M150,60 a90,90 0 0,0 90,90 M195,60 a45,45 0 0,0 45,45 M60,105 a45,-45 0 0,0 45,-45 M240,195 a-45,45 0 0,0 -45,45
|
||||
type:size 10
|
||||
type:color #000000
|
||||
type.write 38,262 "RONIN"
|
||||
path.stroke M60,60 l60,0 a60,60 0 0,1 60,60 M240,60 l0,60 a-60,60 0 0,1 -60,60 M240,240 l-60,0 a-60,-60 0 0,1 -60,-60 M60,240 l0,-60 a60,-60 0 0,1 60,-60 M90,240 l0,-60 a30,-30 0 0,1 30,-30 M60,90 l60,0 a30,30 0 0,1 30,30 M210,60 l0,60 a-30,30 0 0,1 -30,30 M240,210 l-60,0 a-30,-30 0 0,1 -30,-30
|
||||
path.stroke M45,60 l15,0 M45,90 l15,0 M210,45 l0,15 M240,45 l0,15 M255,210 l-15,0 M255,240 l-15,0 M90,255 l0,-15 M60,255 l0,-15
|
||||
path:line_cap round
|
||||
path.stroke M120,60 a60,60 0 0,1 60,60 M240,120 a-60,60 0 0,1 -60,60 M180,240 a-60,-60 0 0,1 -60,-60 M60,180 a60,-60 0 0,1 60,-60
|
||||
path.stroke M120,90 a30,30 0 0,1 30,30 M210,120 a-30,30 0 0,1 -30,30 M180,210 a-30,-30 0 0,1 -30,-30 M90,180 a30,-30 0 0,1 30,-30
|
||||
magnet.grid 1x1 4,4
|
||||
type:size 11
|
||||
type:font "DIN Medium"
|
||||
type.write 38,252 "B09"
|
||||
brush:color #ff0000
|
||||
brush:size 5
|
||||
path:line_width 20
|
||||
path:line_color #999999
|
||||
type.write 45,280 "RONIN"
|
||||
type:font "DIN"
|
||||
type.write 85,280 "09"
|
8
presets/logo_nataniev.rin
Normal file
8
presets/logo_nataniev.rin
Normal file
@ -0,0 +1,8 @@
|
||||
frame.resize 300x300
|
||||
layer.fill #ff0000
|
||||
path:line_width 28
|
||||
path:line_cap round
|
||||
magnet.grid 30x30 2,2
|
||||
frame.select logo
|
||||
path.stroke M60,60 l60,0 a60,60 0 0,1 60,60 M240,60 l0,60 a-60,60 0 0,1 -60,60 M240,240 l-60,0 a-60,-60 0 0,1 -60,-60 M60,240 l0,-60 a60,-60 0 0,1 60,-60 M60,90 l60,0 a30,30 0 0,1 30,30 M210,60 l0,60 a-30,30 0 0,1 -30,30 M240,210 l-60,0 a-30,-30 0 0,1 -30,-30 M90,240 l0,-60 a30,-30 0 0,1 30,-30
|
||||
magnet.grid 1x1 2,2
|
8
presets/logo_neauoire.rin
Normal file
8
presets/logo_neauoire.rin
Normal file
@ -0,0 +1,8 @@
|
||||
frame.resize 300x300
|
||||
layer.fill #ff0000
|
||||
path:line_width 28
|
||||
path:line_cap round
|
||||
magnet.grid 30x30 2,2
|
||||
frame.select logo
|
||||
path.stroke M120,60 a0,90 0 0,0 0,90 a30,30 0 0,0 30,30 M90,60 l0,90 a60,60 0 0,0 60,60 M60,60 l0,90 a90,90 0 0,0 90,90 M180,240 l0,-90 a-30,-30 0 0,0 -30,-30 M210,240 l0,-90 a-60,-60 0 0,0 -60,-60 M240,240 l0,-90 a-90,-90 0 0,0 -90,-90
|
||||
magnet.grid 1x1 2,2
|
12
presets/logo_ronin.rin
Normal file
12
presets/logo_ronin.rin
Normal file
@ -0,0 +1,12 @@
|
||||
frame.resize 300x300
|
||||
layer.fill #ff0000
|
||||
path:line_width 28
|
||||
path:line_cap butt
|
||||
magnet.grid 15x15 4,4
|
||||
frame.select logo
|
||||
path.stroke M60,60 l60,0 a60,60 0 0,1 60,60 M240,60 l0,60 a-60,60 0 0,1 -60,60 M240,240 l-60,0 a-60,-60 0 0,1 -60,-60 M60,240 l0,-60 a60,-60 0 0,1 60,-60 M90,240 l0,-60 a30,-30 0 0,1 30,-30 M60,90 l60,0 a30,30 0 0,1 30,30 M210,60 l0,60 a-30,30 0 0,1 -30,30 M240,210 l-60,0 a-30,-30 0 0,1 -30,-30
|
||||
path.stroke M45,60 l15,0 M45,90 l15,0 M210,45 l0,15 M240,45 l0,15 M255,210 l-15,0 M255,240 l-15,0 M90,255 l0,-15 M60,255 l0,-15
|
||||
path:line_cap round
|
||||
path.stroke M120,60 a60,60 0 0,1 60,60 M240,120 a-60,60 0 0,1 -60,60 M180,240 a-60,-60 0 0,1 -60,-60 M60,180 a60,-60 0 0,1 60,-60
|
||||
path.stroke M120,90 a30,30 0 0,1 30,30 M210,120 a-30,30 0 0,1 -30,30 M180,210 a-30,-30 0 0,1 -30,-30 M90,180 a30,-30 0 0,1 30,-30
|
||||
magnet.grid 1x1 4,4
|
6
presets/neauoire.rin
Normal file
6
presets/neauoire.rin
Normal file
@ -0,0 +1,6 @@
|
||||
frame.resize 300x300
|
||||
layer.fill #72dec2
|
||||
path:line_width 28
|
||||
path:line_cap round
|
||||
magnet.grid 15x15 4,4
|
||||
frame.select logo
|
@ -5,13 +5,13 @@ function Brush(rune)
|
||||
this.pointers = [new Pointer(new Position("0,0"))];
|
||||
|
||||
this.add_mode(new Mode("paint"));
|
||||
this.add_mode(new Mode("erase","alt"));
|
||||
this.add_setting(new Setting("color","#00ff00"));
|
||||
this.add_mode(new Mode("erase","shift"));
|
||||
this.add_setting(new Setting("color","#000000"));
|
||||
this.add_setting(new Setting("size","2"));
|
||||
this.add_method(new Method("add_pointer",["Position","Color","Scale","mirror_x","mirror_y"]));
|
||||
this.add_method(new Method("add",["Position","Color","Scale","mirror_x","mirror_y"]));
|
||||
this.add_method(new Method("clear"));
|
||||
|
||||
this.add_pointer = function(cmd, preview = false)
|
||||
this.add = function(cmd, preview = false)
|
||||
{
|
||||
if(cmd.option("mirror_x")){
|
||||
var mirror_x = parseFloat(cmd.option("mirror_x").value);
|
||||
@ -36,12 +36,12 @@ function Brush(rune)
|
||||
|
||||
this.pointers.push(pointer);
|
||||
|
||||
ronin.terminal.log(new Log(this,"Added pointer at: "+pointer.offset.render()));
|
||||
ronin.terminal.log(new Log(this,"Added pointer at: "+pointer.offset.toString()));
|
||||
|
||||
return 1, "ok";
|
||||
}
|
||||
|
||||
this.clear = function()
|
||||
this.remove = function()
|
||||
{
|
||||
this.pointers = [];
|
||||
return 1,"Removed all pointers.";
|
||||
|
@ -141,6 +141,6 @@ function Pointer(offset = new Position(), color = null, scale = 1)
|
||||
|
||||
this.widget = function()
|
||||
{
|
||||
return this.offset.render();
|
||||
return this.offset.toString();
|
||||
}
|
||||
}
|
@ -18,12 +18,12 @@ function Cursor(rune)
|
||||
if(this.is_inside){
|
||||
this.set_mode(ronin.default)
|
||||
}
|
||||
else if(keyboard.shift_held,keyboard.alt_held){
|
||||
this.set_mode(ronin.frame.active_layer);
|
||||
}
|
||||
else if(ronin.terminal.cmd().module()){
|
||||
this.set_mode(ronin.terminal.cmd().module());
|
||||
}
|
||||
else if(keyboard.shift_held,keyboard.alt_held){
|
||||
this.set_mode(ronin.frame.active_layer);
|
||||
}
|
||||
else if(event && event.altKey == true){
|
||||
this.set_mode(ronin.default);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ function Eye(rune)
|
||||
{
|
||||
var pixel = ronin.frame.context().getImageData(position.x*2, position.y*2, 1, 1).data;
|
||||
var hex = new Color().rgb_to_hex({r:pixel[0],g:pixel[1],b:pixel[2]});
|
||||
ronin.terminal.log(new Log(this,"Color at "+position.render()+" is "+hex));
|
||||
ronin.terminal.log(new Log(this,"Color at "+position.toString()+" is "+hex));
|
||||
}
|
||||
|
||||
// Mouse
|
||||
|
@ -57,7 +57,7 @@ function Frame(rune)
|
||||
|
||||
this.size = rect;
|
||||
|
||||
return 1, "Resized to "+this.size.render();
|
||||
return 1, "Resized to "+this.size.toString();
|
||||
}
|
||||
|
||||
this.select = function(cmd, preview = false)
|
||||
@ -149,9 +149,9 @@ function Frame(rune)
|
||||
|
||||
this.mouse_up = function(position,rect)
|
||||
{
|
||||
ronin.overlay.draw(this.mouse_from,rect)+" "+rect.render();
|
||||
ronin.overlay.draw(this.mouse_from,rect)+" "+rect.toString();
|
||||
|
||||
var line = "frame.resize "+this.mouse_from.render()+" "+rect.render();
|
||||
var line = "frame.resize "+this.mouse_from.toString()+" "+rect.toString();
|
||||
ronin.terminal.update(line);
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ function Frame(rune)
|
||||
{
|
||||
var html = ""
|
||||
|
||||
html += this.size.render()+" ";
|
||||
html += this.size.toString()+" ";
|
||||
html += this.active_layer.name+" ";
|
||||
|
||||
var user_layers = 0;
|
||||
|
@ -84,16 +84,6 @@ function Layer(name,manager = null)
|
||||
return 1, "ok";
|
||||
}
|
||||
|
||||
this.rename = function(params, preview = false)
|
||||
{
|
||||
if(preview){ return; }
|
||||
|
||||
// TODO
|
||||
// ronin.frame.layers[params.text()] = this;
|
||||
// ronin.frame.layers[this.name] = null;
|
||||
ronin.terminal.log(new Log(this,"Renamed layer "+this.name+" to "+params.text()));
|
||||
}
|
||||
|
||||
this.clear = function(params, preview = false)
|
||||
{
|
||||
if(preview){ return; }
|
||||
|
@ -4,6 +4,7 @@ function Magnet(rune)
|
||||
|
||||
this.add_setting(new Setting("grid","1x1"));
|
||||
this.add_setting(new Setting("marker","4,4"));
|
||||
this.add_setting(new Setting("color","#000000"));
|
||||
|
||||
this.add_method(new Method("grid",["rect","position"]));
|
||||
|
||||
@ -17,8 +18,8 @@ function Magnet(rune)
|
||||
this.draw_grid(cmd.rect(),cmd.position());
|
||||
|
||||
if(preview == false){
|
||||
this.settings["grid"].update(cmd.rect().render());
|
||||
this.settings["marker"].update(cmd.position().render());
|
||||
if(cmd.rect()){ this.settings["grid"].update(cmd.rect().toString());}
|
||||
if(cmd.position()){ this.settings["marker"].update(cmd.position().toString());}
|
||||
}
|
||||
|
||||
return 1, preview ? "preview" : "ok";
|
||||
@ -29,8 +30,8 @@ function Magnet(rune)
|
||||
if(!rect){ rect = new Rect("20x20"); }
|
||||
if(!grid){ grid = new Position("4,4"); }
|
||||
|
||||
this.settings["grid"].update(rect.render());
|
||||
this.settings["marker"].update(grid.render());
|
||||
this.settings["grid"].update(rect.toString());
|
||||
this.settings["marker"].update(grid.toString());
|
||||
|
||||
if(rect.width < 5 || rect.height < 5){ return; }
|
||||
|
||||
@ -54,7 +55,7 @@ function Magnet(rune)
|
||||
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 = 'white';
|
||||
this.context().strokeStyle = this.settings["color"].value;
|
||||
this.context().stroke();
|
||||
this.context().closePath();
|
||||
}
|
||||
@ -63,7 +64,7 @@ function Magnet(rune)
|
||||
{
|
||||
this.context().beginPath();
|
||||
this.context().arc(position.x, position.y, size, 0, 2 * Math.PI, false);
|
||||
this.context().fillStyle = 'white';
|
||||
this.context().fillStyle = this.settings["color"].value;
|
||||
this.context().fill();
|
||||
this.context().closePath();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ function Path(rune)
|
||||
|
||||
this.add_setting(new Setting("fill_color","#ff0000"));
|
||||
this.add_setting(new Setting("line_width","3"));
|
||||
this.add_setting(new Setting("line_color","#999"));
|
||||
this.add_setting(new Setting("line_color","#ffffff"));
|
||||
this.add_setting(new Setting("line_cap","square"));
|
||||
|
||||
this.add_method(new Method("stroke",["Positions"],"Add point"));
|
||||
@ -106,7 +106,7 @@ function Path(rune)
|
||||
{
|
||||
var method = ronin.terminal.cmd().method() ? ronin.terminal.cmd().method().name : "stroke";
|
||||
var line = "path."+method+" "+this.create_path();
|
||||
line += "M"+position.render();
|
||||
line += "M"+position.toString();
|
||||
ronin.terminal.update(line);
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ function Path(rune)
|
||||
{
|
||||
var method = ronin.terminal.cmd().method().name;
|
||||
var line = "path."+method+" "+this.create_path();
|
||||
line += "L"+position.render();
|
||||
line += "L"+position.toString();
|
||||
ronin.terminal.update(line);
|
||||
}
|
||||
|
||||
@ -123,22 +123,22 @@ function Path(rune)
|
||||
var method = ronin.terminal.cmd().method().name;
|
||||
|
||||
if(this.coordinates.length == 0){
|
||||
this.coordinates.push("M"+position.render());
|
||||
this.coordinates.push("M"+position.toString());
|
||||
}
|
||||
else{
|
||||
var offset = this.last_pos ? position.offset(this.last_pos) : position;
|
||||
|
||||
if(keyboard.shift_held == true && keyboard.alt_held == true){
|
||||
this.coordinates.push("M"+position.render());
|
||||
this.coordinates.push("M"+position.toString());
|
||||
}
|
||||
else if(keyboard.shift_held == true){
|
||||
this.coordinates.push("a"+offset.render()+" 0 0,1 "+offset.render());
|
||||
this.coordinates.push("a"+offset.toString()+" 0 0,1 "+offset.toString());
|
||||
}
|
||||
else if(keyboard.alt_held == true){
|
||||
this.coordinates.push("a"+offset.render()+" 0 0,0 "+offset.render());
|
||||
this.coordinates.push("a"+offset.toString()+" 0 0,0 "+offset.toString());
|
||||
}
|
||||
else{
|
||||
this.coordinates.push("l"+offset.render());
|
||||
this.coordinates.push("l"+offset.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ function Source(rune)
|
||||
ronin.source.unlock();
|
||||
}
|
||||
|
||||
return 1,"Loaded "+params.filepath().path+" at "+position.render();
|
||||
return 1,"Loaded "+params.filepath().path+" at "+position.toString();
|
||||
}
|
||||
|
||||
this.save = function(params,preview = false)
|
||||
|
@ -27,7 +27,7 @@ function Type(rune)
|
||||
|
||||
if(!preview){ this.layer.remove(this); }
|
||||
|
||||
return 1, "Wrote "+text+" at "+position.render();
|
||||
return 1, "Wrote "+text+" at "+position.toString();
|
||||
}
|
||||
|
||||
// Mouse
|
||||
@ -40,7 +40,7 @@ function Type(rune)
|
||||
this.mouse_down = function(position)
|
||||
{
|
||||
var str = ronin.terminal.cmd().text() ? ronin.terminal.cmd().text() : "Placeholder";
|
||||
var line = "type.write "+position.render()+" \""+str+"\"";
|
||||
var line = "type.write "+position.toString()+" \""+str+"\"";
|
||||
ronin.terminal.update(line);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ function Type(rune)
|
||||
this.mouse_up = function(position)
|
||||
{
|
||||
var str = ronin.terminal.cmd().text() ? ronin.terminal.cmd().text() : "Placeholder";
|
||||
var line = "type.write "+position.render()+" \""+str+"\"";
|
||||
var line = "type.write "+position.toString()+" \""+str+"\"";
|
||||
ronin.terminal.update(line);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ function Angle(angle_str = "0'")
|
||||
|
||||
this.degrees = parseFloat(angle_str.replace('\'',''));
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return this.degrees+"'";
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ function Any(str)
|
||||
this.example = "";
|
||||
this.string = str;
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return this.string;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ function Bang()
|
||||
|
||||
this.example = "";
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return "BANG";
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ function Color(hex = '#000000')
|
||||
return { r:rgb.r/255, g:rgb.g/255, b:rgb.b/255 }
|
||||
}
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return this.hex;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ function Filepath(path_str)
|
||||
this.example = "assets/demo.png";
|
||||
this.path = path_str;
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return this.path;
|
||||
}
|
||||
|
@ -6,11 +6,6 @@ function Mode(name,key = "")
|
||||
this.name = name;
|
||||
this.key = key;
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
return "?";
|
||||
}
|
||||
|
||||
this.toString = function()
|
||||
{
|
||||
return "<span class='mode'>~"+this.name+(this.key ? '['+this.key+']' : '')+"</span>"
|
||||
|
@ -40,7 +40,7 @@ function Position(position_str = "0,0",y = null)
|
||||
}
|
||||
}
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return (isNaN(this.x) ? 0 : this.x)+","+(isNaN(this.y) ? 0 : this.y);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ function Range(range_str)
|
||||
this.from = parseFloat(this.range_str.split("..")[0]);
|
||||
this.to = parseFloat(this.range_str.split("..")[1]);
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return this.from+".."+this.to;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ function Rect(rect_str)
|
||||
|
||||
this.example = "200x300";
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return (isNaN(this.width) ? 0 : this.width)+"x"+(isNaN(this.height) ? 0 : this.height);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ function Setting(name,value)
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return "?";
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ function Value(value_str)
|
||||
this.float = parseFloat(this.value);
|
||||
this.int = parseInt(this.value);
|
||||
|
||||
this.render = function()
|
||||
this.toString = function()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user