p5Drawer
Create a drawer animation emulating Scribit, AxiDraw extremely easy.
Requirements
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.js"></script>
Install
<script src="https://raw.githack.com/doriclaudino/p5.drawer/master/dist/p5.drawer.es5.js"></script>
Start coding!
p5.drawer sketch
//let drawer = new p5Drawer.AxiDrawer()
//let drawer = new p5Drawer.ScribitDrawer()
let drawer = new p5Drawer.Drawer()
drawer.image = //your image
drawer.sound = //your sound
drawer.moveTo(vector, [speed])
Features
- Control speed
- Control soundSpeed based on speed
- Change sounds
- Change Images
- Center images
- Save internal steps
Importing library
You can import the generated bundle to use the whole library generated by this starter:
import { AxiDrawer, Drawer, ScribitDrawer } from 'p5Drawer'
Additionally, you can import the transpiled modules from dist/lib
in case you have a modular library:
import { AxiDrawer, Drawer, ScribitDrawer } from '../src/p5.drawer'
<script src="https://raw.githack.com/doriclaudino/p5.drawer/master/dist/p5.drawer.es5.js"></script>
window.p5Drawer
Resources
Credits
Projects started using typescript-library-starter
Object literals
Let _loadedAssets
_loadedAssets: object
axidrawer
axidrawer: object
image
image: Image = new p5.Image()
imageFile
imageFile: string = "https://raw.githack.com/doriclaudino/p5.drawer/master/assets/images/axidrawer.png"
soundFile
soundFile: string = "https://raw.githubusercontent.com/doriclaudino/p5.drawer/master/assets/sounds/axidrawer.mp3"
drawer
drawer: object
image
image: Image = new p5.Image()
imageFile
imageFile: string = "https://raw.githack.com/doriclaudino/p5.drawer/master/assets/images/pencildrawer.png"
soundFile
soundFile: string = "https://raw.githubusercontent.com/doriclaudino/p5.drawer/master/assets/sounds/pencildrawer.mp3"
scribitdrawer
scribitdrawer: object
image
image: Image = new p5.Image()
imageFile
imageFile: string = "https://raw.githack.com/doriclaudino/p5.drawer/master/assets/images/scribitdrawer.png"
soundFile
soundFile: string = "https://raw.githubusercontent.com/doriclaudino/p5.drawer/master/assets/sounds/axidrawer.mp3"