HTML and CSS Reference
In-Depth Information
Because Canvas is self-contained inside JavaScript, we think there's little hope it could one
day be accessible to screen readers. On the other hand, SVG uses real page elements (such
as <text> ), which means a screen reader “could” potentially interpret the information.
Where are all the SVG games?
You won't find many results from a Google search on “SVG games” as compared to the
results for “Canvas games.” People in the development community aren't catching on to
SVG, in particular for game-based applications. Games require lots of rendering power and
the ability to generate many assets such as particles, enemies, and scenery on the fly. Be-
cause SVG is inside the DOM, large amounts of assets may cause slow performance. In ad-
dition, the large amount of Canvas propaganda isn't helping (in particular for its 3D coun-
terpart, WebGL).
Which should you use?
In our opinion, generating simple graphics and animation is for SVG. If you want to create
an application heavy on raster graphics and processing, use Canvas.
7.4. Summary
SVG isn't limited to games; developers use it for graphic-editing programs, animation
tools, charts, and even HTML5 video. It also allows for resizing backgrounds, screen-
conforming artwork, and interactive logo designs that don't pixelate when enlarged. SVG
awareness is growing, and frontend developers are using it primarily to create flexible web-
site graphics, like the one you see in figure 7.13 .
Search WWH ::

Custom Search