Click or drag to resize

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
SystemObject
  SpriteLibraryAnimationInfo

Namespace:  SpriteLibrary
Assembly:  SpriteLibrary (in SpriteLibrary.dll) Version: 1.0.0.6 (1.0.0.6)
Syntax
C#
public class AnimationInfo

The AnimationInfo type exposes the following members.

Constructors
  NameDescription
Public methodAnimationInfo
Initializes a new instance of the AnimationInfo class
Top
Methods
  NameDescription
Public methodClone
A generic cloning method that works when everything is public
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top
Fields
  NameDescription
Public fieldAnimationToUse
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.
Public fieldAnimSpeed
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.
Public fieldFieldsToUse
The FieldsToUse tracks which of the values in AnimationInfo are important
Public fieldHeight
The height of the sprite to pull from the specified image.
Public fieldImageName
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.
Public fieldMirrorHorizontally
If the sprite is a mirrored copy of a pre-existing sprite, this value states whether or not the sprite is mirrored Horizontally.
Public fieldMirrorVertically
If the sprite is a mirrored copy of a pre-existing sprite, this value states whether or not the sprite is mirrored Vertically.
Public fieldNumFrames
The number of frames to pull, one following the other, from the specified image.
Public fieldRotationDegrees
If the sprite is a rotated copy of a pre-existing sprite, this value tells how many degrees to rotate the sprite.
Public fieldStartPoint
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.
Public fieldWidth
The width of the sprite to pull from the specified image.
Top
See Also