Complex Graphics Object

A complex graphics object is a graphics object made of multiple different states. Each state is a frame or collection of frames, and can be treated as a static or animated object. CGOs are stored in Content Packages, and are made from PNG files and TXT configuration files with the same name as the PNG.

In game, they are represented by instances of the ComplexGraphicsObject type, which can load CGOs from the currently loaded content package. The type has methods that can change the current state and adjust the animation cycle length.

States
A state is a named collection of frames that are defined in terms of how they should be drawn.
 * Static objects store one frame and draw one frame.
 * Animated objects store and draw multiple frames.  An animation cycle length in seconds in specified, which is rounded to the nearest frame.  The animation will cycle through its frames within an animation cycle; this allows the number of frames to change without changing the animation cycle length.
 * Animated draw-one objects are like animated objects, but they only cycle once through the frames, and render the last frame after the cycle has concluded.  Additionally, an event can be raised when the animation cycle completes.  The animation can be started multiple times.
 * Animated adjustable length objects are animated objects that definea maximum (slowest) and minimum (longest) frame.  The screen object can adjust the cycle length, or interpolate it frame-by-frame linearly or smoothstep.  This is useful for sprites that animated faster as they move faster, such as the Player.

Storage and Configuration
CGOs are stored in Content Packages, and overrides to CGOs are stored in an overrides folder. The image itself is a PNG, and a configuration file with the same name as the PNG is stored in the same folder.

The configuration file format for Complex Graphics Objects can be found here .