Skip to content

Global Class

Global variables used by the MonoGame host.

C#
public static class Global

Inheritance object

When true, prevents the keyboard and mouse logic from running.

C#
public static bool BlockSadConsoleInput { get; set; }

The graphics device created by MonoGame.

C#
public static GraphicsDevice GraphicsDevice { get; set; }

A sprite batch used by all of SadConsole to render objects.

C#
public static SpriteBatch SharedSpriteBatch { get; set; }

The output texture. After each screen in SadConsole is drawn, they’re then drawn on this output texture to compose the final scene.

C#
public static RenderTarget2D RenderOutput { get; set; }

Reference to the game timer used in the MonoGame update loop.

C#
public static GameTime UpdateLoopGameTime { get; }

Reference to the game timer used in the MonoGame render loop.

C#
public static GameTime RenderLoopGameTime { get; }

Regenerates the RenderOutput if the desired size doesn’t match the current size.

C#
public static Global.RecreateRenderOutputDelegate RecreateRenderOutput { get; set; }

Resizes the GraphicsDeviceManager by the specified font size.

C#
public static Global.ResizeGraphicsDeviceManagerDelegate ResizeGraphicsDeviceManager { get; set; }

Resets the RenderOutput target and determines the appropriate RenderRect and SadConsole.Settings.Rendering.RenderScale based on the window or fullscreen state.

C#
public static Action ResetRendering { get; set; }

The game component to control SadConsole updates, input, and rendering.

C#
public static SadConsoleGameComponent SadConsoleComponent { get; set; }

The graphics device manager created by MonoGame.

C#
public static GraphicsDeviceManager GraphicsDeviceManager { get; set; }

Sets the GraphicsDevice render target to null, targeting the app window.

C#
public static void ResetGraphicsDevice()

ResizeGraphicsDeviceManagerHandler(Point, int, int, int, int)

Section titled “ResizeGraphicsDeviceManagerHandler(Point, int, int, int, int)”

Resizes the GraphicsDeviceManager by the specified font size.

C#
public static void ResizeGraphicsDeviceManagerHandler(Point fontSize, int width, int height, int additionalWidth, int additionalHeight)

fontSize Microsoft.Xna.Framework.Point
The size of the font to base the final values on.

width int
The count of glyphs along the X-axis.

height int
The count of glyphs along the Y-axis.

additionalWidth int
Additional pixel width to add to the resize.

additionalHeight int
Additional pixel height to add to the resize.

Regenerates the RenderOutput if the desired size doesn’t match the current size.

C#
public static void RecreateRenderOutputHandler(int width, int height)

width int
The width of the render output.

height int
The height of the render output.

Resets the RenderOutput target and determines the appropriate RenderRect and SadConsole.Settings.Rendering.RenderScale based on the window or fullscreen state.

C#
public static void ResetRenderingHandler()