Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jywarren/pntr.js
A simple touch-enable Processing-like Canvas environment
https://github.com/jywarren/pntr.js
Last synced: about 2 months ago
JSON representation
A simple touch-enable Processing-like Canvas environment
- Host: GitHub
- URL: https://github.com/jywarren/pntr.js
- Owner: jywarren
- Created: 2012-09-23T03:17:00.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-09-25T18:56:10.000Z (over 12 years ago)
- Last Synced: 2024-10-14T08:15:34.933Z (3 months ago)
- Language: JavaScript
- Homepage: http://pntr.irateship.com
- Size: 188 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
pntr.js
=======A simple touch-enabled Processing-like Canvas environment
This was written pretty quickly and messily. It's not done. But it can do basic stuff, so have fun. If you add examples please submit them as pull requests.
###Getting started###
I may start putting more useful information in the wiki: https://github.com/jywarren/pntr.js/wiki
Put your code in index.html at the bottom, in the $P.draw() function, like:
$P.initialize({
// pass in options here
setup: function() {
// code to run on start here
},
draw: function() {
// code to run every frame here
$C.fillStyle = "red"
$C.fillRect(0,0,100,100)
}
})For a full guide on Canvas drawing commands, see https://developer.mozilla.org/en-US/docs/Canvas_tutorial
And more specifically for drawing: https://developer.mozilla.org/en-US/docs/Canvas_tutorial/Drawing_shapes
But where in their examples, you'd use: ctx.fillRect(0,0,10,10), you just say: $C.fillRect(0,0,10,10)
###Examples###
* Touch/click dragging: http://pntr.irateship.com/examples/dragging.html
* Gravity: http://pntr.irateship.com/examples/gravity.html###Troubleshooting###
File issues here and I'll help answer questions: https://github.com/jywarren/pntr.js/issues
Fork and improve the code, I'm happy to take pull requests!