Method | Description | |
---|---|---|
Draw ( |
Draws the sprite.
|
|
Initialize ( ) : void |
Initializes the sprite. This creates the SpriteBatch. If you override Initialize, be sure to call base.Initialize to create the SpriteBatch. |
|
Sprite ( Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, int pixelWidth, int pixelHeight, int pixelOffsetX, int pixelOffsetY ) : System |
Creates a new Sprite instance.
|
|
Update ( |
Updates the sprite's current animation.
|
Method | Description | |
---|---|---|
BeginSpriteBatch ( ) : void |
Calls SpriteBatch.Begin with default arguments. Override if you need to change the arguments to SpriteBatch.Begin.
|
|
Sprite ( Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, int pixelWidth, int pixelHeight, int pixelOffsetX, int pixelOffsetY, Vector2 pixelPosition ) : System |
Creates a new Sprite instance.
|
public Draw ( |
||
gameTime | The game's current time. | |
return | void |
public Sprite ( Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, int pixelWidth, int pixelHeight, int pixelOffsetX, int pixelOffsetY ) : System | ||
game | Microsoft.Xna.Framework.Game | The global game instance. |
spriteSheet | Microsoft.Xna.Framework.Graphics.Texture2D | The sprite sheet containing the sprite's animation frames. |
pixelWidth | int | The width of the sprite in pixels. |
pixelHeight | int | The height of the sprite in pixels. |
pixelOffsetX | int | The sprite's X offset, used to to center the sprite on its location. |
pixelOffsetY | int | The sprite's Y offset, used to to center the sprite on its location. |
return | System |
protected Sprite ( Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, int pixelWidth, int pixelHeight, int pixelOffsetX, int pixelOffsetY, Vector2 pixelPosition ) : System | ||
game | Microsoft.Xna.Framework.Game | The global game instance. |
spriteSheet | Microsoft.Xna.Framework.Graphics.Texture2D | The sprite sheet containing the sprite's animation frames. |
pixelWidth | int | The width of the sprite in pixels. |
pixelHeight | int | The height of the sprite in pixels. |
pixelOffsetX | int | The sprite's X offset, used to to center the sprite on its location. |
pixelOffsetY | int | The sprite's Y offset, used to to center the sprite on its location. |
pixelPosition | Vector2 | The sprite position in the display, in pixels. |
return | System |
public Update ( |
||
gameTime | The game's current time. | |
return | void |