-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
47 lines (26 loc) · 1.06 KB
/
README
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
JavaScript Line Drawer
=========================
This is a javascript library used to draw lines on the screen easily and efficiently.
The method is taken from a demo found on http://www.p01.org/releases/Drawing_lines_in_JavaScript/ (I believe it was written by Mathieu 'P01' HENRI)
I turned it into a Prototype class, with some useful functions. This project includes a simple demo in index.html.
There is a demo at http://lines.live2code.ca
or you can check out the code at http://github.com/forrest/javascript-line-class
Line class:
initialize(x1,y1,x2,y2)
line1 = new Line(x1,y1,x2,y2);
update(Ax,Ay,Bx,By)
line1.update((x1,y1,x2,y2))
destroy()
line1.destroy()
start()
returns [x1,y1]
stop()
returns [x2,y2]
Installation
---------------
1) copy and link the lines.js file
2) copy the /images/line_images folder into your project. Set the LINE_PATH variable.
3) You will have to add the style ".line {position:absolute} " to your css.
Testing
--------------
This has been tested in FF3, Safari, IE7 and IE8.