Categories
Canvas

HTML: canvas

1) It is a good idea to use the inline “width” and “height” instead of CSS, to define the canvas size. Weird things happen if you use CSS instead.

2) Browsers that don’t support canvas will display the text inside of it instead.

3) You need to define a context before you start using it: canvas.getContext(‘2d’) will give you a bunch of methods to draw 2d shapes on it. There are other contexts too, dealing with 3d stuff

 

See it in action:

http://experiments.onsubject.com/canvas/