O'Reilly logo

Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL by James L. Williams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6. Creating Games with SVG and RaphaëlJS

One of the problems we saw when creating games with Canvas was that we had to independently track mouse interactions and locations of the drawn objects after rendering was complete. Scalable Vector Graphics (SVG) addresses these concerns by giving us a means to draw objects while retaining their locations as well as to receive events and modify them. In this chapter, you learn the essentials of SVG to get started in creating games. We also discuss how it compares to Canvas in regard to rendering capabilities and the subset of SVG that most clients implement.

Introduction to SVG

Compared to other elements of HTML5, SVG is a relatively mature component, first released in 2001, with its most recent release ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required