November 2011
Intermediate to advanced
348 pages
7h 2m
English
If Quadratic curves don't meet your needs, the Bezier curve might do the trick. Also known as cubic curves, the Bezier curve is the most advanced curvature available with the HTML5 canvas API.

Follow these steps to draw an arbitrary Bezier curve:
window.onload = function(){
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
context.lineWidth = 10;
context.strokeStyle = "black"; // line color
context.moveTo(180, 130);context.bezierCurveTo(150, 10, 420, 10, 420, 180); context.stroke(); ...
Read now
Unlock full access