35
What You Need to Know
It would be good if you knew your way around programming in some kind of modern
language like C, C++, C#, ActionScript 2, ActionScript 3, Java, or JavaScript. However,
we will introduce the Canvas in the first chapter in a way that should ease you into web
programming at the same time.
For Flash developers
JavaScript and ActionScript 1 are essentially the same language. While Adobe took
some liberties with ActionScript 2, you should be very comfortable with JavaScript.
If you have experience with only ActionScript 3, JavaScript might feel like a step
backwards.
For Silverlight/C# developers
Take a deep breath, and think about a time before ASP.NET/C# when you might
have had to develop web apps in VBScript. Keep your mind there, because that is
just about the same space you are about to enter.
How This Book Is Organized
This book is organized into 11 chapters. All the chapters in the second edition have been
updated, revised, and expanded. The first four chapters step you through the HTML
Canvas API by example. The topics covered include text, images, and drawing. These
chapters contain a few finished apps, but for the most part consist of demos designed
to show you the facets of the Canvas API. The next six chapters build upon the Canvas
API by expanding the scope of the examples to application length. In these chapters, we
discuss math and physics applications, video, audio and games, and mobile. The final
chapters introduce a few experimental areas: 3D, multiplayer, Windows 8, and a Canvas
object model.
What you won’t get in this book is a simple run-down and retelling of the published
W3C Canvas API. While we cover portions of the API in detail, some of it is not ap‐
plicable to games. However, if you want to explore the API further, you can find it at
this site.
Instead, we want to bring to light the ways the Canvas can be used to create animation,
games, and entertainment applications for the Web and mobile web.
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Preface | xvii