Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 1

License
-------

MIT