C# Class Category5.Animation

Afficher le fichier Open project: AnyKey/tojam4 Class Usage Examples

Protected Properties

Свойство Type Description
color Color
currentFrame int
frameCount int
frameHeight int
frameWidth int
lastAnimTime float
texture Microsoft.Xna.Framework.Graphics.Texture2D
timeBetweenFrames float

Méthodes publiques

Méthode Description
Animation ( Microsoft.Xna.Framework.Graphics.Texture2D aTexture, int fWidth, int fHeight, float animTime ) : System

Constructor to assign values to all fields

Copy ( ) : Animation
Draw ( SpriteBatch sBatch, Rectangle dest, double direction ) : void

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians

Draw ( SpriteBatch sBatch, Rectangle2D dest, double direction ) : void

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians

Draw ( SpriteBatch sBatch, Vector2 location, double direction ) : void

Draw a frame of the animation to the screen at the given location. Location specifies the CENTER of the frame Direction value orients the frame, and is given in radians

FastDraw ( SpriteBatch sBatch, Rectangle dest ) : void

Draw a frame of the animation to the screen at given location by rectangle bounds without rotation

Update ( float elapsedTime ) : void
resetColor ( ) : void

Reset the color of the animation to what is was originally

setColor ( Color newColor ) : void

Changes the color of the animation permanently

setCurrentFrame ( int newFrame ) : void

Sets the current frame of the animation Frame numbers start at 0 and go to frameCount - 1

Private Methods

Méthode Description
nextFrame ( ) : void

Method Details

Animation() public méthode

Constructor to assign values to all fields
public Animation ( Microsoft.Xna.Framework.Graphics.Texture2D aTexture, int fWidth, int fHeight, float animTime ) : System
aTexture Microsoft.Xna.Framework.Graphics.Texture2D
fWidth int
fHeight int
animTime float
Résultat System

Copy() public méthode

public Copy ( ) : Animation
Résultat Animation

Draw() public méthode

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians
public Draw ( SpriteBatch sBatch, Rectangle dest, double direction ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
dest Microsoft.Xna.Framework.Rectangle
direction double
Résultat void

Draw() public méthode

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians
public Draw ( SpriteBatch sBatch, Rectangle2D dest, double direction ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
dest Rectangle2D
direction double
Résultat void

Draw() public méthode

Draw a frame of the animation to the screen at the given location. Location specifies the CENTER of the frame Direction value orients the frame, and is given in radians
public Draw ( SpriteBatch sBatch, Vector2 location, double direction ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
location Vector2
direction double
Résultat void

FastDraw() public méthode

Draw a frame of the animation to the screen at given location by rectangle bounds without rotation
public FastDraw ( SpriteBatch sBatch, Rectangle dest ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
dest Microsoft.Xna.Framework.Rectangle
Résultat void

Update() public méthode

public Update ( float elapsedTime ) : void
elapsedTime float
Résultat void

resetColor() public méthode

Reset the color of the animation to what is was originally
public resetColor ( ) : void
Résultat void

setColor() public méthode

Changes the color of the animation permanently
public setColor ( Color newColor ) : void
newColor Color
Résultat void

setCurrentFrame() public méthode

Sets the current frame of the animation Frame numbers start at 0 and go to frameCount - 1
public setCurrentFrame ( int newFrame ) : void
newFrame int
Résultat void

Property Details

color protected_oe property

protected Color color
Résultat Color

currentFrame protected_oe property

protected int currentFrame
Résultat int

frameCount protected_oe property

protected int frameCount
Résultat int

frameHeight protected_oe property

protected int frameHeight
Résultat int

frameWidth protected_oe property

protected int frameWidth
Résultat int

lastAnimTime protected_oe property

protected float lastAnimTime
Résultat float

texture protected_oe property

protected Texture2D,Microsoft.Xna.Framework.Graphics texture
Résultat Microsoft.Xna.Framework.Graphics.Texture2D

timeBetweenFrames protected_oe property

protected float timeBetweenFrames
Résultat float