Updated Hints
This commit is contained in:
parent
e1cec80733
commit
5f492209ec
@ -22,7 +22,6 @@
|
||||
<script type="text/javascript" src="scripts/modules/file.load.js"></script>
|
||||
<script type="text/javascript" src="scripts/modules/file.save.js"></script>
|
||||
<script type="text/javascript" src="scripts/modules/help.js"></script>
|
||||
<script type="text/javascript" src="scripts/modules/eraser.js"></script>
|
||||
<script type="text/javascript" src="scripts/modules/surface.js"></script>
|
||||
<script type="text/javascript" src="scripts/modules/surface.layer.js"></script>
|
||||
<script type="text/javascript" src="scripts/modules/eye.js"></script>
|
||||
|
@ -28,8 +28,6 @@ function Brush(rune)
|
||||
if(cmd.value()){
|
||||
this.size = cmd.value().float;
|
||||
}
|
||||
|
||||
this.update_variables(cmd);
|
||||
}
|
||||
|
||||
this.passive = function(cmd)
|
||||
|
@ -24,9 +24,7 @@ function Cursor(rune)
|
||||
|
||||
this.active = function(cmd)
|
||||
{
|
||||
console.log("!");
|
||||
if(cmd.bang()){
|
||||
console.log("??");
|
||||
this.magnetism = null;
|
||||
if(this.layer){ this.layer.remove(this); }
|
||||
return;
|
||||
|
@ -1,79 +0,0 @@
|
||||
function Eraser(rune)
|
||||
{
|
||||
Module.call(this,rune);
|
||||
|
||||
this.parameters = [Value];
|
||||
this.size = 5;
|
||||
|
||||
// Module
|
||||
|
||||
this.position_prev = null;
|
||||
|
||||
this.draw = function()
|
||||
{
|
||||
if(!this.position_prev){this.position_prev = ronin.cursor.position; }
|
||||
if(ronin.brush.size < 0){ this.erase(); return; }
|
||||
|
||||
var position = ronin.cursor.position;
|
||||
|
||||
this.distance += position.distance_to(this.position_prev);
|
||||
|
||||
ronin.surface.context().beginPath();
|
||||
ronin.surface.context().globalCompositeOperation="destination-out";
|
||||
ronin.surface.context().moveTo(this.position_prev.x,this.position_prev.y);
|
||||
ronin.surface.context().lineTo(position.x,position.y);
|
||||
ronin.surface.context().lineCap="round";
|
||||
ronin.surface.context().lineWidth = this.size;
|
||||
ronin.surface.context().strokeStyle = new Color("#ff0000").rgba();
|
||||
ronin.surface.context().stroke();
|
||||
ronin.surface.context().closePath();
|
||||
|
||||
this.position_prev = position;
|
||||
}
|
||||
|
||||
this.active = function(cmd)
|
||||
{
|
||||
if(cmd.value()){
|
||||
this.size = cmd.value().float;
|
||||
}
|
||||
}
|
||||
|
||||
this.passive = function(cmd)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
this.widget_cursor = function()
|
||||
{
|
||||
return ". "+this.size;
|
||||
}
|
||||
|
||||
// Cursor
|
||||
|
||||
this.is_drawing = false;
|
||||
|
||||
this.mouse_down = function(position)
|
||||
{
|
||||
this.is_drawing = true;
|
||||
this.position_prev = null;
|
||||
|
||||
ronin.stroke.new_stroke();
|
||||
}
|
||||
|
||||
this.mouse_move = function(position)
|
||||
{
|
||||
if(this.is_drawing === false){ return; }
|
||||
|
||||
this.draw();
|
||||
|
||||
ronin.stroke.append_stroke(position);
|
||||
}
|
||||
|
||||
this.mouse_up = function(position)
|
||||
{
|
||||
this.is_drawing = false;
|
||||
this.position_prev = null;
|
||||
|
||||
ronin.stroke.save_stroke("eraser");
|
||||
}
|
||||
}
|
@ -28,11 +28,12 @@ function Module(rune)
|
||||
{
|
||||
}
|
||||
|
||||
this.update_variables = function(cmd)
|
||||
this.set_variables = function(cmd)
|
||||
{
|
||||
for (var key in this.variables){
|
||||
if(!cmd.variable(key)){ continue; }
|
||||
this.variables[key] = cmd.variable(key).value;
|
||||
ronin.terminal.log(new Log(this,"Updated "+key+" with "+cmd.variable(key).value));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,12 @@ function Render(rune)
|
||||
h += this.collection[name].parameters[i].name+" ";
|
||||
}
|
||||
}
|
||||
else if(name){
|
||||
for (var key in this.collection){
|
||||
if(name != key.substr(0,name.length)){ continue; }
|
||||
h += key.substr(name.length)+" ";
|
||||
}
|
||||
}
|
||||
else{
|
||||
for (var key in this.collection){
|
||||
h += key+" ";
|
||||
|
@ -88,6 +88,7 @@ function Terminal(rune)
|
||||
var cmd = new Command(content.substring(1).trim().split(" "));
|
||||
|
||||
if(ronin.modules[key]){
|
||||
ronin.modules[key].set_variables(cmd);
|
||||
ronin.modules[key].active(cmd);
|
||||
ronin.terminal.history.push(content);
|
||||
ronin.terminal.history_index = ronin.terminal.history.length-1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user