C# Class Terrarium.Renderer.DirectX.DirectDrawSpriteSurface

Encapsulate the logic for implementing a sprite surface capable of rendering animated sprites.
Exibir arquivo Open project: eugeniomiro/Terrarium Class Usage Examples

Public Methods

Method Description
DirectDrawSpriteSurface ( string spriteName, string spriteImagePath, int xFrames, int yFrames ) : System

Creates a new sprite sheet with the given name from an image. The sheet is broken into sprites given the number of horizontal and vertical frames available on this sheet.

GrabSprite ( int xFrame, int yFrame, Rectangle dest, Rectangle bounds ) : DirectDrawClippedRect

Retreive a sprite that has to be drawn within the given destination rectangle, given the bounds of the viewport.

GrabSprite ( int xFrame, int yFrame, Rectangle dest, Rectangle bounds, int factor ) : DirectDrawClippedRect

Retreive a sprite that has to be drawn within the given destination rectangle, given the bounds of the viewport. Also contains a scaling factor.

GrabSprite ( int xFrame, int yFrame ) : RECT

Grab a sprite given the x,y frame offset

Method Details

DirectDrawSpriteSurface() public method

Creates a new sprite sheet with the given name from an image. The sheet is broken into sprites given the number of horizontal and vertical frames available on this sheet.
public DirectDrawSpriteSurface ( string spriteName, string spriteImagePath, int xFrames, int yFrames ) : System
spriteName string The name of the sprite sheet
spriteImagePath string The path to the image to load.
xFrames int The number of horizontal frames on this sheet.
yFrames int The number of vertical frames on this sheet.
return System

GrabSprite() public method

Retreive a sprite that has to be drawn within the given destination rectangle, given the bounds of the viewport.
public GrabSprite ( int xFrame, int yFrame, Rectangle dest, Rectangle bounds ) : DirectDrawClippedRect
xFrame int Retrieve the Xth horizontal frame.
yFrame int Retrieve the Yth vertical frame.
dest System.Drawing.Rectangle The destination rectangle for the sprite.
bounds System.Drawing.Rectangle The view rectangle bounds.
return DirectDrawClippedRect

GrabSprite() public method

Retreive a sprite that has to be drawn within the given destination rectangle, given the bounds of the viewport. Also contains a scaling factor.
public GrabSprite ( int xFrame, int yFrame, Rectangle dest, Rectangle bounds, int factor ) : DirectDrawClippedRect
xFrame int Retrieve the Xth horizontal frame.
yFrame int Retrieve the Yth vertical frame.
dest System.Drawing.Rectangle The destination rectangle for the sprite.
bounds System.Drawing.Rectangle The view rectangle bounds.
factor int A scaling factor.
return DirectDrawClippedRect

GrabSprite() public method

Grab a sprite given the x,y frame offset
public GrabSprite ( int xFrame, int yFrame ) : RECT
xFrame int Retrieve the Xth horizontal frame.
yFrame int Retrieve the Yth vertical frame.
return RECT