Documentation
What is GAF Format?
GAF stands for Generic Animation Format. It is an extended cut-out animation format. It was designed to store animations, converted from SWF format into an open format, that can be played using any framework/technology on any platform.
GAF format is designed to meet the following goals:
-
GPU accelerated rendering - In contrast to SWF format, GAF is storing all the graphics in raster format, that can be completely rendered on screen using GPU.
-
Visual quality - All the animation parts of the animation baked into Texture Atlas in the highest possible quality to produce the same quality as the original animation in Flash Player during playback.
-
Smallest possible size - Texture Atlas contains only unique parts of the animation in a minimum possible size. GAF Config stores the data in binary format that allows to minimize the size of GAF animation too.
-
Extensibility - The GAF Config format is a tagged format, so it can be evolved with new features while maintaining backward compatibility with earlier versions of the GAF playback libraries.
-
Flexibility - GAF format is designed to store several independent animations; animations, that utilize the same graphical elements; animations, that contain nested animations; animations that shares the same nested animation; several texture atlases in case when there is no possible to place all the graphics into one atlas; Dynamic Text Fields, that can be accessible at runtime. It allows to use GAF not only for an animations, but for the User Interfaces and to cover all the development related to the graphical part of the applications/games.
GAF Format consists of two parts: Texture Atlas and Binary Config.
Texture Atlas
Texture Atlas contains all animation parts that are saved as raster graphics in PNG format. The animation parts are placed densely inside one atlas. But in the case when there is not enough place in a single atlas animation parts can be placed in two and more texture atlases. The maximum number of the generated texture atlases for one animation is not limited.
Also, GAF Converter can generate texture atlases for different screen resolutions. You can create one animation in Flash Pro and then convert it to the GAF for the iOS Retina and non-Retina displays (using CSF settings) and for the wide range of Android devices (using Scale settings). For more information about Scale and CSF conversion settings please read this article: Standalone GAF Converter: Conversion settings.
Binary Config
GAF Binary Config contains the following information:
-
Texture Atlas(es) description;
-
Definition of the each Timeline;
-
Definition of the each animation part in each Timeline. There are three types of the animation parts: Image, Dynamic Text Field and Timeline (Timeline is used as animation part when conversion mode Nesting is used to convert an SWF file);
-
Position, rotation, scale, skew, z-index each of the animation part in each frame where it is changed;
-
Filters and masks which are applied to the animation parts (if they are used);
-
Other overhead data that is used for the animation playback;
Note: GAF Format doesn't contain bones, keyframes, and a tween's data between keyframes (like Dragon Bones or Spine). It is more similar to the SWF format (frame-based format that contains full information about each animation part in the first frame and the other frames contain information about the difference between the current frame and the previous frame).
Animations saved in GAF Format can be played in a number of the frameworks via the GAF playback libraries. Right now we support a few frameworks. But the GAF Format is an open format and developers can develop their own GAF playback libraries for any framework/technology they need. The GAF Binary Config specification is already under development and will be available soon.