C# Class SadConsole.Engine

Show file Open project: Thraka/SadConsole Class Usage Examples

Public Properties

Property Type Description
ClearFrameColor Color
ConsoleRenderStack SadConsole.Consoles.ConsoleList
MonoGameInstance SadConsoleGame
Random System.Random
UnlimitedFPS bool

Public Methods

Method Description
Draw ( GameTime gameTime ) : void
Initialize ( GraphicsDevice device, string font, int consoleWidth, int consoleHeight ) : Console

Initializes SadConsole with only a GraphicsDevice.

Initialize ( GraphicsDeviceManager deviceManager, string font, int consoleWidth, int consoleHeight ) : Console

Prepares the engine for use. This must be the first method you call on the engine when you provide your own GraphicsDeviceManager.

Initialize ( string font, int consoleWidth, int consoleHeight, Action ctorCallback = null ) : void

Prepares the engine for use. This must be the first method you call on the engine, then call Run to start SadConsole.

ResetRendering ( ) : void

Resets the render target and render rect to the size of the WindowWidth and WindowHeight.

RestoreRenderTarget ( ) : void

Only call this if you steal away the render target during the render process.

Run ( ) : void
ToggleFullScreen ( ) : void

Toggles between fullscreen. This safely restores the original window size.

Update ( GameTime gameTime, bool windowIsActive ) : void

Private Methods

Method Description
InitializeCompleted ( ) : void

Method Details

Draw() public static method

public static Draw ( GameTime gameTime ) : void
gameTime GameTime
return void

Initialize() public static method

Initializes SadConsole with only a GraphicsDevice.
public static Initialize ( GraphicsDevice device, string font, int consoleWidth, int consoleHeight ) : Console
device GraphicsDevice
font string The font to load as the .
consoleWidth int The width of the default root console (and game window).
consoleHeight int The height of the default root console (and game window).
return SadConsole.Consoles.Console

Initialize() public static method

Prepares the engine for use. This must be the first method you call on the engine when you provide your own GraphicsDeviceManager.
public static Initialize ( GraphicsDeviceManager deviceManager, string font, int consoleWidth, int consoleHeight ) : Console
deviceManager GraphicsDeviceManager The graphics device manager from MonoGame.
font string The font to load as the .
consoleWidth int The width of the default root console (and game window).
consoleHeight int The height of the default root console (and game window).
return SadConsole.Consoles.Console

Initialize() public static method

Prepares the engine for use. This must be the first method you call on the engine, then call Run to start SadConsole.
public static Initialize ( string font, int consoleWidth, int consoleHeight, Action ctorCallback = null ) : void
font string The font to load as the .
consoleWidth int The width of the default root console (and game window).
consoleHeight int The height of the default root console (and game window).
ctorCallback Action Optional callback from the MonoGame Game class constructor.
return void

ResetRendering() public static method

Resets the render target and render rect to the size of the WindowWidth and WindowHeight.
public static ResetRendering ( ) : void
return void

RestoreRenderTarget() public static method

Only call this if you steal away the render target during the render process.
public static RestoreRenderTarget ( ) : void
return void

Run() public static method

public static Run ( ) : void
return void

ToggleFullScreen() public static method

Toggles between fullscreen. This safely restores the original window size.
public static ToggleFullScreen ( ) : void
return void

Update() public static method

public static Update ( GameTime gameTime, bool windowIsActive ) : void
gameTime GameTime
windowIsActive bool
return void

Property Details

ClearFrameColor public static property

Clears the screen this color each frame.
public static Color ClearFrameColor
return Color

ConsoleRenderStack public static property

A list of consoles that will be rendered.
public static ConsoleList,SadConsole.Consoles ConsoleRenderStack
return SadConsole.Consoles.ConsoleList

MonoGameInstance public static property

A game instance for SadConsole used when calling Initialize(string, int, int).
public static SadConsoleGame,SadConsole MonoGameInstance
return SadConsoleGame

Random public static property

Centralized sudo random number generator used by SadConsole. Replace it with your own seed to replicate specific randomness.
public static Random,System Random
return System.Random

UnlimitedFPS public static property

When true, does not lock at 60fps. Must be set before Initialize(string, int, int) is called.
public static bool UnlimitedFPS
return bool