Table of Contents

Interface IGameWindow

Namespace
BSGameLib.Game
Assembly
BSGameLib.Game.dll

The game's window. The game creates it from its IWindowOptions, and it is reached through IGame.

public interface IGameWindow : IDisposable
Inherited Members

Properties

IsOffscreen

Whether the window is offscreen: it is rendered to but not shown. Set from Offscreen.

bool IsOffscreen { get; }

Property Value

bool

IsUsingVSync

Whether frames are synchronised to the display's refresh rate.

bool IsUsingVSync { get; set; }

Property Value

bool

IsVisible

Whether the window is shown.

bool IsVisible { get; }

Property Value

bool

Size

The size of the window, in pixels.

Vector2 Size { get; }

Property Value

Vector2

Title

The text in the window's title bar.

string Title { get; set; }

Property Value

string

UsableDisplaySize

The area of the display this window is on that a window may occupy - the whole screen less taskbars, docks and panels - in the same units as Size. Null when it cannot be known, such as for an offscreen window.

Vector2? UsableDisplaySize { get; }

Property Value

Vector2?

WindowHandle

The platform's native handle for the window, for interop with code outside the library.

nint WindowHandle { get; }

Property Value

nint

Methods

CenterWindow()

Moves the window to the centre of the display it is on.

void CenterWindow()

Hide()

Hides the window.

void Hide()

SetSize(int, int)

Resizes the window to width by height pixels.

void SetSize(int width, int height)

Parameters

width int
height int

Show()

Shows the window.

void Show()

ShowMessageBox(MessageBoxType, string, string, MessageBoxButtons)

Shows a message box over the window, and returns the button the user chose.

MessageBoxResult ShowMessageBox(MessageBoxType type, string title, string message, MessageBoxButtons buttons)

Parameters

type MessageBoxType
title string
message string
buttons MessageBoxButtons

Returns

MessageBoxResult

ToggleFullscreen(bool)

Makes the window fullscreen when isFullscreen is true, using the desktop's display mode, and makes it a normal window again when false.

void ToggleFullscreen(bool isFullscreen)

Parameters

isFullscreen bool

Events

OnHide

Raised when the window is hidden.

event EventHandler OnHide

Event Type

EventHandler

OnResize

Raised when the window is resized.

event EventHandler<ResizeEventArgs> OnResize

Event Type

EventHandler<ResizeEventArgs>

OnShow

Raised when the window is shown.

event EventHandler OnShow

Event Type

EventHandler