Canvas Examples
Some stuff I got to work. NOTE: All the files are available on
GitHub
.
Learning to Use the HTML5 Canvas
Triangles
: Fill and stroke
Circles and Arcs
: Fill and stroke
Images
: Scale and tile an external image file (photo, JPG)
A Grid of Colored Squares
: Generating colors
Triangles
: Add colors with fill and stroke
Transparency
: Create semi-transparent blocks of color and overlay them on a photo
Lines and Grids
: Drawing sharp, crisp lines
Understanding the canvas coordinates
: A triangle on top of a grid, with x, y coordinates
Animated text
: Use Google fonts to write text on the canvas, and then animate the text
Using Google Web fonts
: This example solves the problem of Google fonts not appearing and also shows you how to position text as you want it
Drawing curves
: Create either quadratic or Bezier curves
Control of a Bezier curve
: Interactive! Click buttons to see how control points alter the shape of the line
Fully interactive dragging
: Drag either one of two squares to change the shape of a curve in realtime.
Animation and Canvas
Canvas Test with Ball
: Uses JavaScript, processing.js
@macloo