Drawing Shapes with the JavaScript Canvas API

1 · · Aug. 5, 2019, 10:21 p.m.
In this article we’ll be looking at the HTML canvas element and the JavaScript canvas API to render complex shapes onto our web pages. Setup All we need to start is an HTML page with a canvas tag and a JavaScript file to manipulate it with. index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta http-equiv="X-UA-Compatible" content="ie=edge"/> <title>HTML Canvas</title> </head> ...