January 2018
Intermediate to advanced
678 pages
20h 16m
English
After drawing graphics objects, wouldn’t it be fun to move them around? Canvas lets you do that. In this section, you’ll learn how to move graphics objects in a straight line, rotate them, and scale them. You’ll learn how to initiate those transformation operations as part of an event handler when the user interacts with the web page. For example, suppose you have a web page that uses canvas to draw an airplane. You could implement a button that, when clicked, moves the airplane forward by 2 pixels and rotates the airplane’s propellers by .1 radians. To make the airplane appear to fly as part of an animation sequence, you can use timer commands to execute the transformation operations repeatedly.
Read now
Unlock full access