Skip to content

chuva-inc/jquery-paper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

jquery-paper

This is a jQuery plugin which adds support for turning canvas elements into Paper.js canvases.

The plugin can either be called with a paperscript file location:

$('#canvas-id').paper('/path/to/paperscript/file.js');

or a function whose this object should be used to store handlers:

$('#canvas-id').paper(function() {
  // draw dots 10px by 10px away from the click point
  this.onMouseDown = function(event) {
    var point = new paper.Point(10, 10)
    var circle = new paper.Path.Circle(event.point.add(point), 5);
    circle.fillColor = 'red';
  };
});

Note: When using a function, you must use the paper namespace for Paper.js specific functions and constructors. You also must explicitly call these methods instead of using overloaded operators:

  • +: add
  • -: subtract
  • *: multiply
  • /: divide
  • %: modulo
  • ==: equals
    • (prefix sign): negate

About

Paperjs integration in jQuery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published