Introduction
The graphimation framework (or GXM for short) is an example framework that was implemented to test the usability of Microsoft Direct 2D Technology for scenarios that involve animations, like games, modern UI and demoscene demos. It is provided to the development community to show the applicability and ease of use with which Direct 2D can map to this problem space.
The framework provides a single Interface called IGraphimation with a few methods that completely hide away the visuals and timing data of animating 2D graphics. Using graphimations, an app can completely focus on its internal mechanics and defer the visual side of itself to the framework.
The intended audience for this document is developers that work on games, animated UI frameworks and demosceners. The audience needs to be familiar with 2D graphics technologies and C++.
What Are Graphimations
A graphimation is a package of graphics that can animate. It is a collection of one or more animations. When the user creates a graphimation object, she can then tell it to render itself on the screen while playing one of its animations.
For example a game developer can have a Soldier class that models a soldier in the game. He can then create a graphimation object for a soldier that has the animations, “stand”, “walk”, “fight”, “die”. After this whenever his Soldier objects change state during the game, he can just tell the IGraphimation object to play the corresponding animation. These animations can be looping (like “walk”) or one-shot (like “die”).
The user creates a graphimation object from an external text based .d2g file. This file includes declarations of the visual and time based data that constitutes the animations.
To use a graphimation all the user needs to know is
- Which d2g file to load
- Which animations does this graphimation object provide
The d2g files can be designed to be customizable from the code. For instance if a soldier graphimation has a “jump” animation, the d2g file can be designed so that the height of the jump is controlled by a “variable”. The IGraphimation interface has a SetVariable() method that the code can use to customize the jump animation.
So in summary, a graphimation object provides an interface that has named animations (that can be played) and named variables (that can be used to customize the animations)
Download Contents
The download package contains the Graphimation framework (Graphimation folder) and three apps that use it
- D2D demo: A demoscene style non interactive demo (GxmPlayer folder)
- Carousel: A sample animated UI widget library (Carousel folder) and a sample app using it (CarouselDemo folder)
- D2DRTS: A sample real time strategy game (D2DRTS folder)
For More Information
This resource accompanies a blog post in Directx Developer Blog. Refer to that post for the story behind the development of this framework.
For more info on how to use the framework in your own apps and internal implementation details, please refer to the User Manual that comes inside the package (Graphimation\doc\GraphimationFramework.docx)