Canvas: The 2D Context
The canvas element in HTML is a complex beast. The specification was originally meant to cover both two- and three-dimensional contexts. However, as of the writing of this book, the 3D context was split from the original specification and reorganized under a new specification named WebGL. If you are working in three-dimensional space, you will use the “webgl” context, and if you are working in two-dimensional space, you will use the “2d” context. The webgl context is developing quite quickly, and there are some absolutely beautiful examples of using the 3D context on the web. However, its use in HTML5 games lags behind the 2D context by quite a lot. Not only are browsers still working on the implementations and details ...
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