C# Class GPSTD_RM.AnimatedSpriteInstance

Maintains a reference to a sprite, frame number, and animation loop.
Show file Open project: dideler/gps-tower-defense Class Usage Examples

Public Methods

Method Description
AnimatedSpriteInstance ( AnimatedSprite sourceSprite, string defaultLoop ) : System

Create a new sprite instance with a sprite and a default loop name.

CurrentTexture ( ) : Microsoft.Xna.Framework.Graphics.Texture2D

Get the current texture, based on the animations loops.

SwitchLoop ( string loopName ) : void

Switch to a new animation loop. Reset the frame number to zero.

Update ( GameTime time ) : void

Called every update cycle to advance the frame when necessary.

Method Details

AnimatedSpriteInstance() public method

Create a new sprite instance with a sprite and a default loop name.
public AnimatedSpriteInstance ( AnimatedSprite sourceSprite, string defaultLoop ) : System
sourceSprite AnimatedSprite The sprite to which this is attached.
defaultLoop string Default animation loop for this instance.
return System

CurrentTexture() public method

Get the current texture, based on the animations loops.
public CurrentTexture ( ) : Microsoft.Xna.Framework.Graphics.Texture2D
return Microsoft.Xna.Framework.Graphics.Texture2D

SwitchLoop() public method

Switch to a new animation loop. Reset the frame number to zero.
public SwitchLoop ( string loopName ) : void
loopName string The name of the new loop.
return void

Update() public method

Called every update cycle to advance the frame when necessary.
public Update ( GameTime time ) : void
time Microsoft.Xna.Framework.GameTime The current game time.
return void