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.
Afficher le fichier Open project: Tesserex/C--MegaMan-Engine Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

public Begin ( ) : void
Résultat void

DelayedCall() public méthode

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.
Résultat void

FadeTransition() public méthode

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.
Résultat void

GetLayerVisibility() public méthode

public GetLayerVisibility ( int layer ) : bool
layer int
Résultat bool

Pause() public méthode

public Pause ( ) : void
Résultat void

SetLayerVisibility() public méthode

public SetLayerVisibility ( int layer, bool visibility ) : void
layer int
visibility bool
Résultat void

Start() public méthode

public Start ( ) : void
Résultat void

Stop() public méthode

public Stop ( ) : void
Résultat void

UnloadAudio() public méthode

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

Unpause() public méthode

public Unpause ( ) : void
Résultat void