Progress toward Ronin source files.
This commit is contained in:
@@ -32,6 +32,7 @@ function Mode_Guide()
|
||||
|
||||
this.mouse_up = function(event)
|
||||
{
|
||||
this.live_draw_from = null;
|
||||
commander.element_input.focus();
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ function Mode()
|
||||
|
||||
this.mouse_down = function(event)
|
||||
{
|
||||
|
||||
console.log("??");
|
||||
}
|
||||
|
||||
this.mouse_move = function(event)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user