C# Class MegaMan.Engine.Engine

This engine class controls the low level behaviors. Its main job is keeping a "heartbeat" at a constant framerate. Basically, it's the main loop for the game - logic, then draw, repeat. It also holds the device context that things will draw with, and has some basic drawing control functions.
Datei anzeigen Open project: Tesserex/C--MegaMan-Engine Class Usage Examples

Public Methods

Method Description
Begin ( ) : void
DelayedCall ( System.Action callback, Action progress, int delay ) : void

Calls a function after a given number of frames.

FadeTransition ( System.Action callback, System.Action finished = null ) : void

Fades the screen to black, calls an optional callback function, and then fades back in, and calls another callback function when done.

GetLayerVisibility ( int layer ) : bool
Pause ( ) : void
SetLayerVisibility ( int layer, bool visibility ) : void
Start ( ) : void
Stop ( ) : void
UnloadAudio ( ) : void

Disposes of all audio objects. If you try to play audio after this is called, you will get an error.

Unpause ( ) : void

Private Methods

Method Description
Application_Idle ( ) : void
CheckInput ( ) : void
Engine ( ) : System
KeyToInput ( Keys key ) : GameInput
RenderContext ( int layer ) : void
Step ( float dt ) : bool
opacityDown ( System.Action callback ) : void
opacityUp ( ) : void

Method Details

Begin() public method

public Begin ( ) : void
return void

DelayedCall() public method

Calls a function after a given number of frames.
public DelayedCall ( System.Action callback, Action progress, int delay ) : void
callback System.Action The callback function to call.
progress Action A function called each frame to report the progress of the delay.
delay int The number of frames to wait before calling.
return void

FadeTransition() public method

Fades the screen to black, calls an optional callback function, and then fades back in, and calls another callback function when done.
public FadeTransition ( System.Action callback, System.Action finished = null ) : void
callback System.Action The function to call when the screen is black. Can be null.
finished System.Action The function to call when the transition is finished. Can be null.
return void

GetLayerVisibility() public method

public GetLayerVisibility ( int layer ) : bool
layer int
return bool

Pause() public method

public Pause ( ) : void
return void

SetLayerVisibility() public method

public SetLayerVisibility ( int layer, bool visibility ) : void
layer int
visibility bool
return void

Start() public method

public Start ( ) : void
return void

Stop() public method

public Stop ( ) : void
return void

UnloadAudio() public method

Disposes of all audio objects. If you try to play audio after this is called, you will get an error.
public UnloadAudio ( ) : void
return void

Unpause() public method

public Unpause ( ) : void
return void