Progress toward Ronin source files.

This commit is contained in:
Devine Lu Linvega
2016-12-19 13:57:31 -07:00
parent 53898a5881
commit 29ca5aa5cd
17 changed files with 173 additions and 86 deletions

View File

@@ -32,6 +32,7 @@ function Mode_Guide()
this.mouse_up = function(event)
{
this.live_draw_from = null;
commander.element_input.focus();
}
}

View File

@@ -9,7 +9,7 @@ function Mode()
this.mouse_down = function(event)
{
console.log("??");
}
this.mouse_move = function(event)

View File

@@ -3,36 +3,38 @@ function Mode_Paint()
Mode.call(this);
this.name = "Paint";
this.is_drawing = false;
this.mouse_down = function(event)
this.mouse_down = function(position)
{
this.is_drawing = true;
for (i = 0; i < ronin.brush.pointers.length; i++) {
ronin.brush.pointers[i].start();
}
ronin.stroke.new_stroke();
}
this.mouse_move = function(event)
this.mouse_move = function(position)
{
if(this.is_drawing === false){return;}
// this.position = new Position(event.clientX - parseFloat(ronin.surface.style.left) - parseFloat(ronin.canvas.element.style.left),event.clientY- parseFloat(ronin.surface.style.top) - parseFloat(ronin.canvas.element.style.top));
ronin.brush.position = ronin.position_in_canvas(event);
if(this.is_drawing === false){ return; }
for (i = 0; i < ronin.brush.pointers.length; i++) {
ronin.brush.pointers[i].draw();
}
ronin.stroke.append_stroke(position);
}
this.mouse_up = function(event)
this.mouse_up = function(position)
{
this.is_drawing = false;
for (i = 0; i < ronin.brush.pointers.length; i++) {
ronin.brush.pointers[i].stop();
}
ronin.stroke.save_stroke();
}
}