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
파일 보기 프로젝트 열기: MichaelAquilina/Some-2D-RPG

공개 메소드들

메소드 설명
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