Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/tvstatic
Generate TV static in an HTML5 canvas element
https://github.com/bahamas10/tvstatic
Last synced: 2 months ago
JSON representation
Generate TV static in an HTML5 canvas element
- Host: GitHub
- URL: https://github.com/bahamas10/tvstatic
- Owner: bahamas10
- Created: 2013-02-09T09:20:03.000Z (almost 12 years ago)
- Default Branch: gh-pages
- Last Pushed: 2013-02-09T09:23:02.000Z (almost 12 years ago)
- Last Synced: 2024-05-08T19:53:27.472Z (8 months ago)
- Language: JavaScript
- Homepage: http://bahamas10.github.com/tvstatic/
- Size: 109 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
TV Static
=========Generate TV static in an HTML5 canvas element
View the demo online http://bahamas10.github.com/tvstatic/
![screenshot](http://www.daveeddy.com/static/media/github/static.png)
Usage
-----``` html
var canvas, ctx;
window.addEventListener('load', load, false);
function load() {
canvas = document.getElementById('canvas');
ctx = canvas.getContext('2d');
ctx.fillStyle = '#000';requestAnimationFrame(render);
}function render() {
requestAnimationFrame(render);
ctx.clearRect(0, 0, canvas.width, canvas.height);tvstatic(canvas, ctx, 2);
}```
tvstatic()
----------### `tvstatic(canvas, ctx, [scale])`
- `canvas`: the canvas object on which to overlay static
- `ctx`: the 2d context of the canvas above
- `scale`: the scale to use when drawing pixels, defaults to 1License
-------MIT