What Does Canvas Offer?
Even though Canvas lacks some of the features that make the Flash platform very nice for game development, it also has some strengths.
- A powerful single stage
HTML5 Canvas is closely akin to the Flash Stage. It is a rectangular piece of screen real estate that can be manipulated programmatically. Advanced Flash developers might recognize Canvas as a close cousin to both the
BitmapDataandShapeobjects in ActionScript. We can draw directly to the canvas with paths and images and transform them on the fly.- Logical display objects
Canvas gives us a single physical display object, but we can create any number of logical display objects. We will use JavaScript objects to hold all of the logical data and methods we need to draw and transform our logical game objects to the physical canvas.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access