-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
49 lines (39 loc) · 1.19 KB
/
test.js
File metadata and controls
49 lines (39 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*************************************************************************************************/
var testPath = (function () {
var c1 = new Coord(),
c2 = new Coord({x:10, y:10});
b1 = new Ball(100, 210),
b2 = new Ball(5, 5, 5),
p1 = new Path(),
img = new Image(),
cvs = $('#cvsFront').get(0),
ctx = cvs.getContext('2d');
ctx.save();
ctx.fillStyle = 'blue';
ctx.fillRect(0, 0, 400, 400);
ctx.restore();
$(img).load(function (ev) {
//ctx.drawImage(img, 0, 0);
var leer = new Plane(b1, img, img);
leer.setScale(.25);
leer.selected = true;
leer.img.onload = function() {
leer.draw(ctx);
leer.clear(ctx);
leer.move(new Coord({x:200, y:210}));
leer.draw(ctx);
console.log(leer);
};
console.log('leer instanceof Plane', leer instanceof Plane);
});
// img.src = 'img/AirlinerClr.jpg';
img.src = 'img/Leer.jpg';
ctx.fillStyle = 'red';
b2.draw(ctx);
console.log(c1, c2, b1, b2, p1);
console.log('p1.isEmpty', p1.isEmpty(), p1.length);
console.log('p1.isEmpty', p1.isEmpty(), p1.length);
console.log(p1);
console.log('p1.isEmpty', p1.isEmpty(), p1.length);
console.log(p1);
})();