C# Класс Category5.Animation

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
color Color
currentFrame int
frameCount int
frameHeight int
frameWidth int
lastAnimTime float
texture Microsoft.Xna.Framework.Graphics.Texture2D
timeBetweenFrames float

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

Метод Описание
Animation ( Microsoft.Xna.Framework.Graphics.Texture2D aTexture, int fWidth, int fHeight, float animTime ) : System

Constructor to assign values to all fields

Copy ( ) : Animation
Draw ( SpriteBatch sBatch, Rectangle dest, double direction ) : void

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians

Draw ( SpriteBatch sBatch, Rectangle2D dest, double direction ) : void

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians

Draw ( SpriteBatch sBatch, Vector2 location, double direction ) : void

Draw a frame of the animation to the screen at the given location. Location specifies the CENTER of the frame Direction value orients the frame, and is given in radians

FastDraw ( SpriteBatch sBatch, Rectangle dest ) : void

Draw a frame of the animation to the screen at given location by rectangle bounds without rotation

Update ( float elapsedTime ) : void
resetColor ( ) : void

Reset the color of the animation to what is was originally

setColor ( Color newColor ) : void

Changes the color of the animation permanently

setCurrentFrame ( int newFrame ) : void

Sets the current frame of the animation Frame numbers start at 0 and go to frameCount - 1

Приватные методы

Метод Описание
nextFrame ( ) : void

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

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

Constructor to assign values to all fields
public Animation ( Microsoft.Xna.Framework.Graphics.Texture2D aTexture, int fWidth, int fHeight, float animTime ) : System
aTexture Microsoft.Xna.Framework.Graphics.Texture2D
fWidth int
fHeight int
animTime float
Результат System

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

public Copy ( ) : Animation
Результат Animation

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

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians
public Draw ( SpriteBatch sBatch, Rectangle dest, double direction ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
dest Microsoft.Xna.Framework.Rectangle
direction double
Результат void

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

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians
public Draw ( SpriteBatch sBatch, Rectangle2D dest, double direction ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
dest Rectangle2D
direction double
Результат void

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

Draw a frame of the animation to the screen at the given location. Location specifies the CENTER of the frame Direction value orients the frame, and is given in radians
public Draw ( SpriteBatch sBatch, Vector2 location, double direction ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
location Vector2
direction double
Результат void

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

Draw a frame of the animation to the screen at given location by rectangle bounds without rotation
public FastDraw ( SpriteBatch sBatch, Rectangle dest ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
dest Microsoft.Xna.Framework.Rectangle
Результат void

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

public Update ( float elapsedTime ) : void
elapsedTime float
Результат void

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

Reset the color of the animation to what is was originally
public resetColor ( ) : void
Результат void

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

Changes the color of the animation permanently
public setColor ( Color newColor ) : void
newColor Color
Результат void

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

Sets the current frame of the animation Frame numbers start at 0 and go to frameCount - 1
public setCurrentFrame ( int newFrame ) : void
newFrame int
Результат void

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

color защищенное свойство

protected Color color
Результат Color

currentFrame защищенное свойство

protected int currentFrame
Результат int

frameCount защищенное свойство

protected int frameCount
Результат int

frameHeight защищенное свойство

protected int frameHeight
Результат int

frameWidth защищенное свойство

protected int frameWidth
Результат int

lastAnimTime защищенное свойство

protected float lastAnimTime
Результат float

texture защищенное свойство

protected Texture2D,Microsoft.Xna.Framework.Graphics texture
Результат Microsoft.Xna.Framework.Graphics.Texture2D

timeBetweenFrames защищенное свойство

protected float timeBetweenFrames
Результат float