Table of Contents

Class Window

Namespace
MohawkGame2D
Assembly
GAME 10003 Game Development Foundations - 2D Game Template.dll

Access window information.

public static class Window
Inheritance
Window
Inherited Members

Properties

CurrentFPS

How many frames-per-second the window is running at.

public static float CurrentFPS { get; }

Property Value

float

Height

Height of window in pixels.

public static int Height { get; set; }

Property Value

int

Size

Size of window in pixels.

public static Vector2 Size { get; set; }

Property Value

Vector2

TargetFPS

How many frames-per-second (FPS) the game tries to output every second.

public static int TargetFPS { get; set; }

Property Value

int

Title

Title displayed on top of program window.

public static string Title { get; set; }

Property Value

string

Width

Width of window in pixels.

public static int Width { get; set; }

Property Value

int

Methods

CentreWindow()

Centre window within the current monitor.

public static void CentreWindow()

ClearBackground(Color)

Clears the window canvas to the specified color.

public static void ClearBackground(Color color)

Parameters

color Color

The background color to paint.

SetFpsToMonitorRefreshRate()

VSync. Sets the FPS target to the monitor's refresh rate.

public static void SetFpsToMonitorRefreshRate()

Remarks

The monitor selected is based on which monitor the window is currently in.

SetSize(int, int)

Set the window size in pixels.

public static void SetSize(int width, int height)

Parameters

width int

Width of window in pixels.

height int

Height of window in pixels.

SetTitle(string)

Set the program window title.

public static void SetTitle(string value)

Parameters

value string

The new title to display.