Coder Social home page Coder Social logo

paperdotjs-presentation's Introduction

Paper.js

http://paperjs.org/

What is it?

Paper.js is vector graphics scripting framework that runs using HTML5's Canvas. It was originally designed in reference to Scriptographer, a tool built to extend Adobe Illustrator's capabilities using JavaScript. With the advent of Adobe CS6, Scriptographer is no longer supported, but Paper.js can now implement much of the same functionality that it's progenitor provided.

Vector graphics? Wut?

If you aren't familiar with the difference between raster and vector graphics:

Basically raster graphics are just images described by bitmap, while vector graphics are described using the mathematics of polygons. They are represented by the Adobe programs Photoshop and Illustrator, respectively.

Objectives

  • Demonstrate some of the capabilities of Paper.js, including:
  • Creating simple paths.
  • Creating a simple animation.
  • Working with polygons, circles, and path smoothing.
  • Creating simple user drawing tools.
  • Changing paper objects' styling, including color, stroke, and positioning.

Preparation

  1. Fork and clone this repository.
  2. Create a new branch for your work.
  3. npm install dependencies.
  4. Install paper with npm install paper.
  5. Run grunt serve, and navigate your browser to http://localhost:8080.

If you run into any problems, excellent documentation is provided at this site. There are also instructions for installation through a download.

TIME FOR SOME SWEET, SWEET ART!!!

You guy's better be ready...

Demo: Watch me make some simple shapes

The most important part of incorportating Paper.js into the system of dependecies used at GA is requiring paper in the global scope. Paper is exposed with a require in the root directory index.js. This allows us to access paper anywhere within our code.

In order to get Paper to work, we need to create our first paper scope object on document ready. You can see in assets/scripts/index.js that the first method invoked is paper.install(window). After this, we can then create different event handlers that can then be called to start whatever drawing we wish to create:

  • Simple line
  • Rotating rectangle and smoothing
  • Circles and anchor points
  • A user drawing tool!
  • Describing, copying and deleting styles

Additional Resources

Source code distributed under the MIT license.

paperdotjs-presentation's People

Contributors

modularjon avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.