Start learning with our library of video tutorials taught by experts. Get started
Viewed by members. in countries. members currently watching.
One of the most exciting additions that HTML5 offers to designers is the ability to draw free-form graphics on a drawing surface known as the Canvas. In this course, author Joe Marini introduces the technical concepts behind Canvas and shows how to perform drawing operations directly in a web page. The course covers drawing basic and complex shapes, setting colors and styles, adding shadows, patterns, and gradients, more advanced techniques such as scaling, rotating, and compositing objects, and how to incorporate Canvas elements in a slideshow and an animation.
The HTML5 canvas provides a lot of drawing operations to learn about. So what I'm going to do first is show you a quick overview of the kinds of things that we're going to learn how to do in this course. So using HTML5 canvas, we'll learn about how to draw lines, and you can see this is the example here. This is the actual finished example that we're going to build. And you can see that we can draw lines of varying thickness with different end caps and different kinds of joins. We'll see how to draw arcs. And again, these are the finished examples that you're going to be able to build when you've watched that particular section.
So here we do have some arcs. Some of them are filled. We can draw text in the canvas using various effects. We've got some colors, and sizes, and stroking and filling going on, We'll see how to do things like draw shadows, so these are objects that have shadows with them. You can see that the shadow color and blur effect can be changed depending on the type of object that you're drawing. We'll also see how to do things like draw gradients, both linear gradients, as in this example, and radial gradients. Then we'll move on to some more advanced stuff, like seeing how the canvas can draw using different compositing methods.
These compositing methods affect how objects are drawn to the canvas, and there are twelve of them and you can see the examples here. And again, you'll be building this later on in the title. Then we will see how to use things like transformations to move objects around on the canvas and affect how they are drawn. And you can do things like rotate and scale and translate. This is the rotate one. We'll see how to do this later. Then we move on to some more advanced operations. I'll show you how to build animations like this one, where we have a box moving across a blue canvas, and we'll build something a little more advanced than that even.
We'll build a nice little slideshow rotator. You can see that this is rotating through some pictures that are being drawn to a canvas. So these are the examples that we're going to be building, and you might want to fire up your code editor, because we're going to just dive right in and start building stuff.
There are currently no FAQs about HTML5: Graphics and Animation with Canvas.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.