C# Класс SadConsole.Engine

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ClearFrameColor Color
ConsoleRenderStack SadConsole.Consoles.ConsoleList
MonoGameInstance SadConsoleGame
Random System.Random
UnlimitedFPS bool

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

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

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

Метод Описание
InitializeCompleted ( ) : void

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

Draw() публичный статический Метод

public static Draw ( GameTime gameTime ) : void
gameTime GameTime
Результат void

Initialize() публичный статический Метод

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).
Результат SadConsole.Consoles.Console

Initialize() публичный статический Метод

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).
Результат SadConsole.Consoles.Console

Initialize() публичный статический Метод

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

ResetRendering() публичный статический Метод

Resets the render target and render rect to the size of the WindowWidth and WindowHeight.
public static ResetRendering ( ) : void
Результат void

RestoreRenderTarget() публичный статический Метод

Only call this if you steal away the render target during the render process.
public static RestoreRenderTarget ( ) : void
Результат void

Run() публичный статический Метод

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

ToggleFullScreen() публичный статический Метод

Toggles between fullscreen. This safely restores the original window size.
public static ToggleFullScreen ( ) : void
Результат void

Update() публичный статический Метод

public static Update ( GameTime gameTime, bool windowIsActive ) : void
gameTime GameTime
windowIsActive bool
Результат void

Описание свойств

ClearFrameColor публичное статическое свойство

Clears the screen this color each frame.
public static Color ClearFrameColor
Результат Color

ConsoleRenderStack публичное статическое свойство

A list of consoles that will be rendered.
public static ConsoleList,SadConsole.Consoles ConsoleRenderStack
Результат SadConsole.Consoles.ConsoleList

MonoGameInstance публичное статическое свойство

A game instance for SadConsole used when calling Initialize(string, int, int).
public static SadConsoleGame,SadConsole MonoGameInstance
Результат SadConsoleGame

Random публичное статическое свойство

Centralized sudo random number generator used by SadConsole. Replace it with your own seed to replicate specific randomness.
public static Random,System Random
Результат System.Random

UnlimitedFPS публичное статическое свойство

When true, does not lock at 60fps. Must be set before Initialize(string, int, int) is called.
public static bool UnlimitedFPS
Результат bool