Added missing files.
This commit is contained in:
parent
e52a72ab43
commit
b7e2247ac0
3
links/main.css
Normal file
3
links/main.css
Normal 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
46
scripts/brush.js
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user