evanw / glfx.js

An image effects library for JavaScript using WebGL
https://evanw.github.io/glfx.js/
MIT License
3.28k stars 403 forks source link

Update canvas.js #21

Open lexxai opened 10 years ago

lexxai commented 10 years ago

Allow use own HTML canvas, by canvas = fx.canvas('canvasid'); <canvas id="canvasid" ....

petethepig commented 10 years ago

+1

denkan commented 7 years ago

Looking for this. However, would rather pass the HTMLCanvasElement as param to fx.canvas(), as I may not have a certain id on the canvas element.

var c = document.getElementById('canvasid'); 

// or I could use this:
// var c = document.getElementsByTagName('canvas')[0];

canvas = fx.canvas(c);