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
Datei anzeigen Open project: MichaelAquilina/Some-2D-RPG

Public Methods

Method 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 method

public BitmapDrawable ( ) : System
return System

Draw() public method

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
return void

GetHeight() public method

public GetHeight ( double elapsedMS ) : int
elapsedMS double
return int

GetSourceRectangle() public method

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
return Rectangle?

GetSourceTexture() public method

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
return Microsoft.Xna.Framework.Graphics.Texture2D

GetWidth() public method

public GetWidth ( double elapsedMS ) : int
elapsedMS double
return int

IsFinished() public method

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
return bool