Property | Type | Description | |
---|---|---|---|
_drawHitbox | bool | ||
_hurtFlashing | bool | ||
_rotation | float | ||
centerPosition | Vector2 | ||
hitboxHorizRatio | float | ||
hitboxRadius | float | ||
hitboxVertRatio | float | ||
randomDropChance | int | ||
texturebox |
Method | Description | |
---|---|---|
ApplyVelocity ( System.TimeSpan elapsedTime ) : void |
Applies the current velocity to the sprite given the time elapsed since the last update call.
|
|
Destroy ( ) : void | ||
Hide ( ) : void |
Makes the sprite invisible
|
|
IsOffScreen ( ) : bool |
Used to determine if the sprite is offscreen (used for de-activation)
|
|
Render ( Microsoft spriteBatch ) : void |
Renders the Sprite with it's current texture
|
|
ScaleSize ( decimal scale ) : void | ||
SetSize ( Vector2 newSize ) : void | ||
Show ( ) : void |
Makes the sprite visible
|
|
Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, int health = 1 ) : System | ||
Update ( |
Used to update the sprite for changing position or taking actions. This is best called in the Update part of the game loop
|
Method | Description | |
---|---|---|
MoveBy ( Vector2 deltaVector ) : void | ||
MoveBy ( float deltaX, float deltaY ) : void | ||
MoveTo ( Vector2 position ) : void | ||
MoveTo ( float x, float y ) : void | ||
SetVelocity ( Vector2 newVelocity ) : void | ||
SetVelocity ( Vector2 destination, int speed ) : void |
public ApplyVelocity ( System.TimeSpan elapsedTime ) : void | ||
elapsedTime | System.TimeSpan | Time elapsed since the last update |
return | void |
protected MoveBy ( Vector2 deltaVector ) : void | ||
deltaVector | Vector2 | |
return | void |
protected MoveBy ( float deltaX, float deltaY ) : void | ||
deltaX | float | |
deltaY | float | |
return | void |
public Render ( Microsoft spriteBatch ) : void | ||
spriteBatch | Microsoft | The spritebatch to use for rendering |
return | void |
protected SetVelocity ( Vector2 newVelocity ) : void | ||
newVelocity | Vector2 | |
return | void |
protected SetVelocity ( Vector2 destination, int speed ) : void | ||
destination | Vector2 | |
speed | int | |
return | void |
public Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, int health = 1 ) : System | ||
texture | Microsoft.Xna.Framework.Graphics.Texture2D | |
position | Vector2 | |
health | int | |
return | System |
public Update ( |
||
gameTime | The amount of time elapsed since the last call | |
return | void |