C# Class GameEngine.Drawing.Bitmap.BitmapDrawable

Represents a GameDrawable Item that renders some form of bitmap Texture to the screen. Any IGameDrawable subclass that wishes to make use of drawing functionality capable of drawing textures to the screen, this abstract class provides all the drawing logic and just requires the implementation of GetSourceRectangle and GetSourceTexture to be implemented.
Inheritance: IGameDrawable
Afficher le fichier Open project: MichaelAquilina/Some-2D-RPG

Méthodes publiques

Méthode Description
BitmapDrawable ( ) : System
Draw ( SpriteBatch spriteBatch, Rectangle destRectangle, Color color, float rotation, Vector2 origin, SpriteEffects spriteEffects, float layerDepth, double elapsedMS ) : void
GetHeight ( double elapsedMS ) : int
GetSourceRectangle ( double elapsedMS ) : Rectangle?

Returns a Rectangle object specifing the SourceRectangle to be used when drawing the SourceTexture specified with GetSourceTexture. Takes an elapsedMS parameter in the case where the Bitmap sublcass would return different SourceRectangles based on the current time (example Animation).

GetSourceTexture ( double elapsedMS ) : Microsoft.Xna.Framework.Graphics.Texture2D

Returns the SourceTexture from which all Draw operations will be performed from. Takes an elapsedMS parameter in the case where the Bitmap subclass would return different Textures based on the current time.

GetWidth ( double elapsedMS ) : int
IsFinished ( double elapsedMS ) : bool

BitmapDrawable provides a default out-of-the-box value - however it is overridable in the case where the value changes with the specified parameter.

Method Details

BitmapDrawable() public méthode

public BitmapDrawable ( ) : System
Résultat System

Draw() public méthode

public Draw ( SpriteBatch spriteBatch, Rectangle destRectangle, Color color, float rotation, Vector2 origin, SpriteEffects spriteEffects, float layerDepth, double elapsedMS ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
destRectangle Microsoft.Xna.Framework.Rectangle
color Color
rotation float
origin Vector2
spriteEffects SpriteEffects
layerDepth float
elapsedMS double
Résultat void

GetHeight() public méthode

public GetHeight ( double elapsedMS ) : int
elapsedMS double
Résultat int

GetSourceRectangle() public méthode

Returns a Rectangle object specifing the SourceRectangle to be used when drawing the SourceTexture specified with GetSourceTexture. Takes an elapsedMS parameter in the case where the Bitmap sublcass would return different SourceRectangles based on the current time (example Animation).
public GetSourceRectangle ( double elapsedMS ) : Rectangle?
elapsedMS double
Résultat Rectangle?

GetSourceTexture() public méthode

Returns the SourceTexture from which all Draw operations will be performed from. Takes an elapsedMS parameter in the case where the Bitmap subclass would return different Textures based on the current time.
public GetSourceTexture ( double elapsedMS ) : Microsoft.Xna.Framework.Graphics.Texture2D
elapsedMS double
Résultat Microsoft.Xna.Framework.Graphics.Texture2D

GetWidth() public méthode

public GetWidth ( double elapsedMS ) : int
elapsedMS double
Résultat int

IsFinished() public méthode

BitmapDrawable provides a default out-of-the-box value - however it is overridable in the case where the value changes with the specified parameter.
public IsFinished ( double elapsedMS ) : bool
elapsedMS double
Résultat bool