mattdesl / canvas-sketch

[beta] A framework for making generative artwork in JavaScript and the browser.
MIT License
5.05k stars 394 forks source link

Add option for canvas id to settings object #74

Closed Yvee1 closed 5 years ago

Yvee1 commented 5 years ago

I was thinking of trying out the Pts.js library with this, and it accesses the canvas with an id attribute. For such use cases, I think it would be nice to have the possibility to specify an id in the settings object. So using e.g. const settings = {id: "pts"} would create a <canvas id="pts" ...> element.

Is this worth adding or is there already an easy and clean way of doing this?

Yvee1 commented 5 years ago

I guess creating your own canvas, setting the id and passing it in the options is good enough..

Yvee1 commented 5 years ago

Actually, this is not needed for Pts.js, since I got it working with the supplied context instead. I realize this option is a bit redundant so I'll close this.