mirror of
https://github.com/rough-stuff/rough.git
synced 2026-04-22 03:00:28 -04:00
.
This commit is contained in:
35
README.md
35
README.md
@@ -7,19 +7,42 @@
|
||||
<b>Rough.js</b> is a light weight, stand-alone [Canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) based library that lets you draw in a _sketchy_, _hand-drawn-like_, style.
|
||||
The library defines primitives to draw lines, curves, arcs, polygons, circles, and ellipses. It also supports drawing [SVG paths](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths).
|
||||
|
||||
## Documentation & Examples
|
||||
## Install
|
||||
|
||||
The latest Rough.js can be downloaded from the [dist folder](https://github.com/pshihn/rough/tree/master/dist).
|
||||
|
||||
or from npm:
|
||||
|
||||
```
|
||||
npm install --save roughjs
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const rough = new RoughCanvas(document.getElementById('canvas'), 800, 800);
|
||||
rough.rectangle(5, 5, 90, 90);
|
||||
rough.circle(80, 170, 50);
|
||||
rough.ellipse(300, 100, 150, 80);
|
||||
rough.line(80, 170, 300, 100);
|
||||
```
|
||||
|
||||
and check out more examples at [roughjs.com](https://roughjs.com).
|
||||
|
||||
## API & Documentation
|
||||
|
||||
Check out the website: [roughjs.com](https://roughjs.com)
|
||||
|
||||
## API
|
||||
and
|
||||
|
||||
[Rough.js API](https://github.com/pshihn/rough/wiki)
|
||||
[Full Rough.js API](https://github.com/pshihn/rough/wiki)
|
||||
|
||||
## Releases
|
||||
|
||||
The latest Rough.js release (beta version 0.1): [Download](https://roughjs.com/builds/rough.zip)
|
||||
|
||||
## Credits
|
||||
|
||||
This project was inspired by [Handy](http://www.gicentre.net/handy/), a java based library for [Processing](https://processing.org/).
|
||||
Rough.js borrows some core algorithms from Handy, but it is _not a JS port_ for processing.js.
|
||||
|
||||
|
||||
## License
|
||||
[MIT License](https://github.com/pshihn/rough/blob/master/LICENSE) (c) [Preet Shihn](https://twitter.com/preetster)
|
||||
Reference in New Issue
Block a user