C# Класс GameEngine.Drawing.Bitmap.Animation

Animation class that allows the user to specify metrics about animation frames from a spritesheet. Also allows specification of other meta properties such as the Delay between frames, whether the animation should loop and what methods to provide information about current frame information based on the Game Time.
Наследование: BitmapDrawable
Показать файл Открыть проект

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

Метод Описание
Animation ( Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, Rectangle frames, int frameDelay = FRAME_DELAY_DEFAULT, bool loop = false ) : System

Initialises an Animation object specifies a SpriteSheet to us and the individual frame locations within the sheet the use. Optionally, the Delay between Frame changes and whether the animation should loop when complete can be passed as constructor parameters.

GetFrame ( double elapsedMS ) : Rectangle

Returns the Current Frame to show in the sprite sheet based on the current games running time.

GetFrameIndex ( double elapsedMS ) : int

Returns the current Frame Index as an integer value based on the GameTime parameters passed into this method.

GetSourceRectangle ( double elapsedMS ) : Rectangle?
GetSourceTexture ( double elapsedMS ) : Microsoft.Xna.Framework.Graphics.Texture2D
IsFinished ( double elapsedMS ) : bool

Specifies whether the Animation has completed. If the Animation is of Looping type, then this method will always return a true. For non-looping animations, this method should return a true once it has passed its last frame. The GameTime parameter is required to determine its current position based on the current GameTime.

ToString ( ) : string

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

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

Initialises an Animation object specifies a SpriteSheet to us and the individual frame locations within the sheet the use. Optionally, the Delay between Frame changes and whether the animation should loop when complete can be passed as constructor parameters.
public Animation ( Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, Rectangle frames, int frameDelay = FRAME_DELAY_DEFAULT, bool loop = false ) : System
spriteSheet Microsoft.Xna.Framework.Graphics.Texture2D Texture2D object that represents the SpriteSheet to use for this animation.
frames Microsoft.Xna.Framework.Rectangle Array of Rectangle objects that specify the locations in the spritesheet to use as frames.
frameDelay int
loop bool bool value specifying wheter the animation should re-start at the end of the animation frames. Defaults to false.
Результат System

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

Returns the Current Frame to show in the sprite sheet based on the current games running time.
public GetFrame ( double elapsedMS ) : Rectangle
elapsedMS double
Результат Microsoft.Xna.Framework.Rectangle

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

Returns the current Frame Index as an integer value based on the GameTime parameters passed into this method.
public GetFrameIndex ( double elapsedMS ) : int
elapsedMS double
Результат int

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

public GetSourceRectangle ( double elapsedMS ) : Rectangle?
elapsedMS double
Результат Rectangle?

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

public GetSourceTexture ( double elapsedMS ) : Microsoft.Xna.Framework.Graphics.Texture2D
elapsedMS double
Результат Microsoft.Xna.Framework.Graphics.Texture2D

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

Specifies whether the Animation has completed. If the Animation is of Looping type, then this method will always return a true. For non-looping animations, this method should return a true once it has passed its last frame. The GameTime parameter is required to determine its current position based on the current GameTime.
public IsFinished ( double elapsedMS ) : bool
elapsedMS double
Результат bool

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

public ToString ( ) : string
Результат string