C# Class Tilengine.Engine

Mostrar archivo Open project: megamarc/Tilengine Class Usage Examples

Public Properties

Property Type Description
Animations Tilengine.Animation[]
Layers Tilengine.Layer[]
Sprites Tilengine.Sprite[]

Public Methods

Method Description
BeginFrame ( int frame ) : void

Starts active rendering of the current frame

This method is used for active rendering combined with DrawNextScanline(), instead of using delegates for raster effects

Deinit ( ) : void

Deinits engine and frees associated resources

DrawNextScanline ( ) : bool

Draws the next scanline of the frame when doing active rendering (without delegates)

GetAvailableSprite ( ) : Sprite

Init ( int hres, int vres, int numLayers, int numSprites, int numAnimations ) : Engine

Initializes the graphic engine

This is a singleton object: calling Init multiple times will return the same reference

SetRenderTarget ( byte data, int pitch ) : void

Sets the output surface for rendering

The render target pixel format must be 32 bits RGBA

Private Methods

Method Description
Engine ( int hres, int vres, int numLayers, int numSprites, int numAnimations ) : System
TLN_BeginFrame ( int frame ) : void
TLN_Deinit ( ) : void
TLN_DrawNextScanline ( ) : bool
TLN_GetAvailableSprite ( ) : int
TLN_GetHeight ( ) : int
TLN_GetLastError ( ) : Error
TLN_GetNumLayers ( ) : int
TLN_GetNumObjects ( ) : uint
TLN_GetNumSprites ( ) : int
TLN_GetUsedMemory ( ) : uint
TLN_GetVersion ( ) : uint
TLN_GetWidth ( ) : int
TLN_Init ( int hres, int vres, int numlayers, int numsprites, int numanimations ) : bool
TLN_InitBPP ( int hres, int vres, int bpp, int numlayers, int numsprites, int numanimations ) : bool
TLN_SetBGBitmap ( IntPtr bitmap ) : bool
TLN_SetBGColor ( int r, int g, int b ) : void
TLN_SetBGPalette ( IntPtr palette ) : bool
TLN_SetLastError ( Error error ) : void
TLN_SetRasterCallback ( RasterCallback callback ) : void
TLN_SetRenderTarget ( byte data, int pitch ) : void
TLN_UpdateFrame ( int time ) : void

Method Details

BeginFrame() public method

Starts active rendering of the current frame
This method is used for active rendering combined with DrawNextScanline(), instead of using delegates for raster effects
public BeginFrame ( int frame ) : void
frame int Timestamp value
return void

Deinit() public method

Deinits engine and frees associated resources
public Deinit ( ) : void
return void

DrawNextScanline() public method

Draws the next scanline of the frame when doing active rendering (without delegates)
public DrawNextScanline ( ) : bool
return bool

GetAvailableSprite() public method

public GetAvailableSprite ( ) : Sprite
return Sprite

Init() public static method

Initializes the graphic engine
This is a singleton object: calling Init multiple times will return the same reference
public static Init ( int hres, int vres, int numLayers, int numSprites, int numAnimations ) : Engine
hres int horizontal resolution in pixels
vres int vertical resolution in pixels
numLayers int number of layers
numSprites int number of sprites
numAnimations int number of animations
return Engine

SetRenderTarget() public method

Sets the output surface for rendering
The render target pixel format must be 32 bits RGBA
public SetRenderTarget ( byte data, int pitch ) : void
data byte Array of bytes that will hold the render target
pitch int Number of bytes per each scanline of the framebuffer
return void

Property Details

Animations public_oe property

public Animation[],Tilengine Animations
return Tilengine.Animation[]

Layers public_oe property

public Layer[],Tilengine Layers
return Tilengine.Layer[]

Sprites public_oe property

public Sprite[],Tilengine Sprites
return Tilengine.Sprite[]