C# Класс 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.
Показать файл Открыть проект Примеры использования класса

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

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

Приватные методы

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

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

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

public Begin ( ) : void
Результат void

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

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

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

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

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

public GetLayerVisibility ( int layer ) : bool
layer int
Результат bool

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

public Pause ( ) : void
Результат void

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

public SetLayerVisibility ( int layer, bool visibility ) : void
layer int
visibility bool
Результат void

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

public Start ( ) : void
Результат void

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

public Stop ( ) : void
Результат void

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

Disposes of all audio objects. If you try to play audio after this is called, you will get an error.
public UnloadAudio ( ) : void
Результат void

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

public Unpause ( ) : void
Результат void