GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - forrest/javascript-line-class: This is a Prototype class called "Line" which can be used to efficiently draw lines with JavaScript.

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
images/line_images
images/line_images
 
 
javascripts
javascripts
 
 
.DS_Store
.DS_Store
 
 
README
README
 
 
index.html
index.html
 
 

Repository files navigation

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.

About

This is a Prototype class called "Line" which can be used to efficiently draw lines with JavaScript.

live2code.ca

Resources

Readme
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.