C# Класс Terrarium.Renderer.DirectX.DirectDrawSpriteSurface

Encapsulate the logic for implementing a sprite surface capable of rendering animated sprites.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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

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

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

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.
Результат System

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

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.
Результат DirectDrawClippedRect

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

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.
Результат DirectDrawClippedRect

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

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.
Результат RECT