C# Class geek.GameEngine.Sprites.AnimatedSprite

This is a game component that implements IUpdateable.
Inheritance: SpriteBase
Mostra file Open project: impworks/xna.geek.engine Class Usage Examples

Public Properties

Property Type Description
Looped bool

Public Methods

Method Description
AnimatedSprite ( GameObject parent, Microsoft.Xna.Framework.Graphics.Texture2D tex, int frameCount, float frameRate ) : System
Draw ( SpriteBatch batch, bool disableLayering = false ) : void

Draws the current sprite frame to the screen.

GetTextureRegion ( Rectangle rect ) : Color[]

Get a portion of the current frame's texture as a sequence of colors.

Pause ( ) : void

Pauses the animation at current frame.

Reset ( ) : void

Reset the sprite.

SetFrame ( int frame ) : void

Sets the current frame.

Start ( ) : void

Start the animation.

Stop ( ) : void

Stops the animation and rewinds it to the first frame.

Update ( ) : void

Update the sprite.

Method Details

AnimatedSprite() public method

public AnimatedSprite ( GameObject parent, Microsoft.Xna.Framework.Graphics.Texture2D tex, int frameCount, float frameRate ) : System
parent geek.GameEngine.Visuals.GameObject
tex Microsoft.Xna.Framework.Graphics.Texture2D
frameCount int
frameRate float
return System

Draw() public method

Draws the current sprite frame to the screen.
public Draw ( SpriteBatch batch, bool disableLayering = false ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Sprite batch.
disableLayering bool Whether to use layer ordering or not.
return void

GetTextureRegion() public method

Get a portion of the current frame's texture as a sequence of colors.
public GetTextureRegion ( Rectangle rect ) : Color[]
rect Microsoft.Xna.Framework.Rectangle Rectangle to retrieve.
return Color[]

Pause() public method

Pauses the animation at current frame.
public Pause ( ) : void
return void

Reset() public method

Reset the sprite.
public Reset ( ) : void
return void

SetFrame() public method

Sets the current frame.
public SetFrame ( int frame ) : void
frame int Frame id (0-based).
return void

Start() public method

Start the animation.
public Start ( ) : void
return void

Stop() public method

Stops the animation and rewinds it to the first frame.
public Stop ( ) : void
return void

Update() public method

Update the sprite.
public Update ( ) : void
return void

Property Details

Looped public_oe property

The flag indicating whether animation should loop after it has finished, or display the last frame until it's changed.
public bool Looped
return bool