Improved brush

This commit is contained in:
Devine Lu Linvega 2017-04-18 09:23:12 -10:00
parent 2fa538af30
commit a2ec49f3aa
5 changed files with 22 additions and 5 deletions

View File

@ -39,6 +39,7 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium"
#terminal hint line .input .module { background: #222; } #terminal hint line .input .module { background: #222; }
#terminal hint line .input .method { background: #333; } #terminal hint line .input .method { background: #333; }
#terminal hint line .input .setting { background: #444; } #terminal hint line .input .setting { background: #444; }
#terminal hint line .input .comment { background: #222;width:100%;display: inline-block }
#terminal textarea { display: block;position: fixed;top: 100px;width: calc(40vw - 16px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #ccc;border-left:1px solid #333;margin-left:15px} #terminal textarea { display: block;position: fixed;top: 100px;width: calc(40vw - 16px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #ccc;border-left:1px solid #333;margin-left:15px}
#terminal textarea:hover { border-left:1px solid #555; } #terminal textarea:hover { border-left:1px solid #555; }

View File

@ -1,5 +1,9 @@
~ Blank ~ Blank Setup
frame.resize 400x400 frame.resize 400x400
layer.fill #A1A1A1 layer.fill #A1A1A1
brush:color #ff0000
~ Add Code Below
brush:color #333333
brush:size 3

View File

@ -8,11 +8,18 @@ function Pointer(offset = new Position(), color = new Color('000000'))
// Parameters // Parameters
this.actual_thickness = 0;
this.thickness = function() this.thickness = function()
{ {
var ratio = 10/this.position().distance_to(this.position_prev[0]); var ratio = 10/this.position().distance_to(this.position_prev[0]);
ratio = ratio > 1 ? 1 : ratio; ratio = ratio > 1 ? 1 : ratio;
return parseInt(ronin.brush.settings["size"]) * ratio; var target = parseFloat(ronin.brush.settings["size"]) * ratio;
if(this.actual_thickness < target){ this.actual_thickness += 0.4; }
if(this.actual_thickness > target){ this.actual_thickness -= 0.4; }
return this.actual_thickness;
} }
// //

View File

@ -70,8 +70,8 @@ function Layer(name,manager = null)
this.fill = function(params,preview = false) this.fill = function(params,preview = false)
{ {
if(preview){ return; } if(!params.color()){ return 0, "Color?"; }
if(!params.color()){ return; } if(preview){ return 0, "No Preview"; }
var rect = params.rect() ? params.rect() : new Rect(this.element.width+"x"+this.element.height); var rect = params.rect() ? params.rect() : new Rect(this.element.width+"x"+this.element.height);
var position = params.position() ? params.position() : new Position("0,0"); var position = params.position() ? params.position() : new Position("0,0");

View File

@ -120,6 +120,11 @@ function Terminal(rune)
{ {
var line = line; var line = line;
console.log(line[0])
// Comment
if(line[0] == "~"){ line = "<span class='comment'>"+line+"</span>"; }
// Method // Method
if(line.indexOf(".") > 0){ if(line.indexOf(".") > 0){
var module = line.split(".")[0]; var module = line.split(".")[0];