Added missing files.

This commit is contained in:
Devine Lu Linvega 2016-11-11 18:00:05 -08:00
parent e52a72ab43
commit b7e2247ac0
2 changed files with 49 additions and 0 deletions

3
links/main.css Normal file
View File

@ -0,0 +1,3 @@
body { margin:0px; padding:0px; overflow:hidden;}
canvas:hover { cursor: crosshair;}
#commander { background:black; padding:15px; position:fixed; bottom:30; color:white; left:30px; border:0; width:calc(100vw - 60px); font-family:courier; cursor:pointer;}

46
scripts/brush.js Normal file
View File

@ -0,0 +1,46 @@
function Brush()
{
this.position = new Position();
this.is_drawing = false;
// Pointers
this.pointers = [new Pointer(new Position(0,0))];
this.add_pointer = function(pointer)
{
this.pointers.push(pointer);
}
// Draw
this.draw = function(e)
{
if(this.is_drawing === false){return;}
this.position = new Position(e.clientX,e.clientY);
for (i = 0; i < this.pointers.length; i++) {
this.pointers[i].draw();
}
}
this.draw_start = function(e)
{
this.is_drawing = true;
for (i = 0; i < this.pointers.length; i++) {
this.pointers[i].start();
}
}
this.draw_stop = function(e)
{
this.is_drawing = false;
for (i = 0; i < this.pointers.length; i++) {
this.pointers[i].stop();
}
}
}