SpriteLibrary

# AnimationInfo Class

An AnimationInfo class is used by the SpriteInfo class to contain the instructions for creating a sprite through the dictionary. Most people will not want to manually use these. It is simplest to use the SpriteDatabase.OpenEditWindow function and use the built-in sprite editor. That editor will create a file that can be used in the database without your needing to know about the AnimationInfo. Again, you do not want to use these within your program. Let the SpriteDatabase use this. The reason these are visible to the program is because This code uses "XML Serialization" to load and save. XML Serialization requires the items you are serializing to be "public", which makes them visible.
Inheritance Hierarchy
System
Object
SpriteLibrary
AnimationInfo

Namespace: SpriteLibrary
Assembly: SpriteLibrary (in SpriteLibrary.dll) Version: 1.0.0.5 (1.0.0.5)
Syntax
C#
Copy

    public class AnimationInfo

The AnimationInfo type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| AnimationInfo | Initializes a new instance of the AnimationInfo class

Top
Methods

| Name | Description
--- | --- | ---
| Clone | A generic cloning method that works when everything is public
| Equals | (Inherited from Object.)
| Finalize | (Inherited from Object.)
| GetHashCode | (Inherited from Object.)
| GetType | (Inherited from Object.)
| MemberwiseClone | (Inherited from Object.)
| ToString | (Inherited from Object.)

Top
Fields

| Name | Description
--- | --- | ---
| AnimationToUse | If the sprite is either a mirror sprite, or a rotated sprite, it must be based off of a pre-existing animation. This value states which animation we copy.
| AnimSpeed | The delay in milliseconds in-between frames of the sprite. This number is not exact, but is pretty close to what happens. Never use a number less than 20.
| FieldsToUse | The FieldsToUse tracks which of the values in AnimationInfo are important
| Height | The height of the sprite to pull from the specified image.

ImageName

This is the image name which contains the sprite. This image should be in the Properties.Resources of your project. The name you want to give is case-sensitive, and should be the exact name as listed in Properties.Resources. For example, if your image name were Properties.Resources.Runner you would want to use the string "Runner" Note the caps are identical, and we have removed the "Properties.Resources. from the front.

| MirrorHorizontally | If the sprite is a mirrored copy of a pre-existing sprite, this value states whether or not the sprite is mirrored Horizontally.
| MirrorVertically | If the sprite is a mirrored copy of a pre-existing sprite, this value states whether or not the sprite is mirrored Vertically.
| NumFrames | The number of frames to pull, one following the other, from the specified image.
| RotationDegrees | If the sprite is a rotated copy of a pre-existing sprite, this value tells how many degrees to rotate the sprite.
| StartPoint | If the sprite is based off of an image, this value is the starting point of the top-left corner of the sprite on the image. You will also want to include a Width and Height.
| Width | The width of the sprite to pull from the specified image.

Top
See Also

#### Reference

SpriteLibrary Namespace