HTML and CSS Reference
Importing Flash Assets
Bruno Garcia, co-founder, 2DKit
The first generation of HTML5 games was simply about fighting to reach an acceptable frame rate. These games were
mainly developed by individual hackers or tiny, programmer-led teams and featured mainly static artwork.
These days, we're seeing a coming of age in HTML5 games. Devices and browsers are fast enough to push more
pixels, teams are growing to include more artists, and there's an increasing focus on visual quality to rival native
But, what tools are there to create HTML5 animations? As it turns out, there are very few, and many game artists
are already trained in using Flash. Can we leverage those skills in the production of HTML5 games?
In this chapter, I will be presenting three different approaches to exporting assets from Flash into HTML5 games:
sprite sheets, vectorization, and cutout animation.
By far the simplest and most common approach is to render each frame of the animation to an image and then pack
those images into a single texture atlas, or sprite sheet, as shown in Figure 7-1 . Metadata, such as frame size and
Figure 7-1. A sprite sheet containing eight frames of a walk animation