C# Класс XNATestBed.Sprite

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
isAnimated bool
isMoving bool
movementDestination Vector2
position Vector2
visible bool

Открытые методы

Метод Описание
CopyFromSprite ( Sprite loadedSprite ) : void
Draw ( SpriteBatch spriteBatch ) : void

Draw the sprite at its current position.

Draw ( SpriteBatch spriteBatch, Vector2 drawingPosition ) : void

Draw the sprite at the specified position. Assumes the sprite is not moving.

Draw ( SpriteBatch spriteBatch, float rotation ) : void

Draw the sprite at its current position with a given radian rotation. (This is a flimsy function for special cases. Will be updated when needed.)

LoadContent ( Microsoft.Xna.Framework.Content.ContentManager contentManager, string textureName ) : void

Load the texture for the sprite using the Content Pipeline If no frames specified, then assume the sprite will never be animated and thus has only 1 frame.

LoadContent ( Microsoft.Xna.Framework.Content.ContentManager contentManager, string textureName, int maxNumOfFrames, int maxNumOfFrameSets ) : void

Load the texture for the sprite using the Content Pipeline

Sprite ( ) : System
Sprite ( Sprite loadedSprite ) : System
StartAnimation ( float aniInterval, bool onlyAnimateOnce ) : void

Using the sprite's current frame and frame set, animate through its frameset either indefinitely or at least once, at the given interval.

StartMovement ( Vector2 destinationPosition, float moveSpeed ) : void

Set the sprite to move from its current drawing position to the given position, at the specified speed.

StartMovementTimed ( Vector2 destinationPosition, float timeToMove ) : void

Set the sprite to move from its current drawing position to the given position, completing it within the specified time.

Update ( GameTime gameTime ) : void

Описание методов

CopyFromSprite() публичный Метод

public CopyFromSprite ( Sprite loadedSprite ) : void
loadedSprite Sprite
Результат void

Draw() публичный Метод

Draw the sprite at its current position.
public Draw ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
Результат void

Draw() публичный Метод

Draw the sprite at the specified position. Assumes the sprite is not moving.
public Draw ( SpriteBatch spriteBatch, Vector2 drawingPosition ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
drawingPosition Vector2
Результат void

Draw() публичный Метод

Draw the sprite at its current position with a given radian rotation. (This is a flimsy function for special cases. Will be updated when needed.)
public Draw ( SpriteBatch spriteBatch, float rotation ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
rotation float
Результат void

LoadContent() публичный Метод

Load the texture for the sprite using the Content Pipeline If no frames specified, then assume the sprite will never be animated and thus has only 1 frame.
public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager contentManager, string textureName ) : void
contentManager Microsoft.Xna.Framework.Content.ContentManager
textureName string
Результат void

LoadContent() публичный Метод

Load the texture for the sprite using the Content Pipeline
public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager contentManager, string textureName, int maxNumOfFrames, int maxNumOfFrameSets ) : void
contentManager Microsoft.Xna.Framework.Content.ContentManager
textureName string
maxNumOfFrames int
maxNumOfFrameSets int
Результат void

Sprite() публичный Метод

public Sprite ( ) : System
Результат System

Sprite() публичный Метод

public Sprite ( Sprite loadedSprite ) : System
loadedSprite Sprite
Результат System

StartAnimation() публичный Метод

Using the sprite's current frame and frame set, animate through its frameset either indefinitely or at least once, at the given interval.
public StartAnimation ( float aniInterval, bool onlyAnimateOnce ) : void
aniInterval float
onlyAnimateOnce bool
Результат void

StartMovement() публичный Метод

Set the sprite to move from its current drawing position to the given position, at the specified speed.
public StartMovement ( Vector2 destinationPosition, float moveSpeed ) : void
destinationPosition Vector2
moveSpeed float
Результат void

StartMovementTimed() публичный Метод

Set the sprite to move from its current drawing position to the given position, completing it within the specified time.
public StartMovementTimed ( Vector2 destinationPosition, float timeToMove ) : void
destinationPosition Vector2
timeToMove float
Результат void

Update() публичный Метод

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Результат void

Описание свойств

isAnimated публичное свойство

public bool isAnimated
Результат bool

isMoving публичное свойство

public bool isMoving
Результат bool

movementDestination публичное свойство

public Vector2 movementDestination
Результат Vector2

position публичное свойство

public Vector2 position
Результат Vector2

visible публичное свойство

public bool visible
Результат bool