Property | Type | Description | |
---|---|---|---|
rotation | float |
Method | Description | |
---|---|---|
Draw ( |
Draws the sprite to the screen at the given location.
|
|
Sprite ( ) : System | ||
Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D image, int rows, int columns ) : System | ||
Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D image, int rows, int columns, bool backAndForth ) : System | ||
Update ( |
||
addState ( string state, int first, int last, bool looping, bool sweeping ) : void |
Creates a new state and adds it to the sprite. Deletes the default state the first time this is called. If the current state is the default state, the method shall check to see if the current frame is outside of the new range and shall adjust so that it is not.
|
|
changeState ( string state ) : bool |
Changes the current animation state of the sprite.
|
|
getState ( ) : string |
This method returns the name of the curren state.
|
|
isComplete ( ) : bool | ||
loadSprite ( Microsoft.Xna.Framework.Graphics.Texture2D image, int rows, int columns, bool sweeping ) : void |
Loads a sprite with an image. Note: This function will clear any classes
|
|
loadSprite ( Microsoft.Xna.Framework.Graphics.Texture2D image, int rows, int columns, int frameRate ) : void |
Alternative wrapper for backwards compatibility
|
|
removeState ( string state ) : void |
Removes the specified state from the sprite.
|
public Draw ( |
||
canvas | An initialized SpriteBatch to which the sprite will be drawn. | |
location | The location as a vector to which the sprite should be drawn. | |
origin | Vector2 | The origin around which the sprite should rotate |
return | void |
public Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D image, int rows, int columns ) : System | ||
image | Microsoft.Xna.Framework.Graphics.Texture2D | |
rows | int | |
columns | int | |
return | System |
public Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D image, int rows, int columns, bool backAndForth ) : System | ||
image | Microsoft.Xna.Framework.Graphics.Texture2D | |
rows | int | |
columns | int | |
backAndForth | bool | |
return | System |
public Update ( |
||
gameTime | ||
return | void |
public addState ( string state, int first, int last, bool looping, bool sweeping ) : void | ||
state | string | The name for the new state. |
first | int | The first frame of the new state. |
last | int | The last frame of the new state. |
looping | bool | Whether or not the animation of the current state should loop. |
sweeping | bool | Whether or not the animation of the current state plays back and forth. |
return | void |
public changeState ( string state ) : bool | ||
state | string | The new state for the sprite. |
return | bool |
public loadSprite ( Microsoft.Xna.Framework.Graphics.Texture2D image, int rows, int columns, bool sweeping ) : void | ||
image | Microsoft.Xna.Framework.Graphics.Texture2D | The image to be used for the sprite. |
rows | int | The number of frame rows in the image. |
columns | int | The number of frame columns in the image. |
sweeping | bool | |
return | void |
public loadSprite ( Microsoft.Xna.Framework.Graphics.Texture2D image, int rows, int columns, int frameRate ) : void | ||
image | Microsoft.Xna.Framework.Graphics.Texture2D | The image to be used for the sprite. |
rows | int | The number of frame rows in the image. |
columns | int | The number of frame columns in the image. |
frameRate | int | The frame rate at which the sprite updates. |
return | void |
public removeState ( string state ) : void | ||
state | string | The name of the state to remove. |
return | void |