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
IsUsingVSync
Whether frames are synchronised to the display's refresh rate.
bool IsUsingVSync { get; set; }
Property Value
IsVisible
Whether the window is shown.
bool IsVisible { get; }
Property Value
Size
The size of the window, in pixels.
Vector2 Size { get; }
Property Value
Title
The text in the window's title bar.
string Title { get; set; }
Property Value
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
WindowHandle
The platform's native handle for the window, for interop with code outside the library.
nint WindowHandle { get; }
Property Value
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
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
typeMessageBoxTypetitlestringmessagestringbuttonsMessageBoxButtons
Returns
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
isFullscreenbool
Events
OnHide
Raised when the window is hidden.
event EventHandler OnHide
Event Type
OnResize
Raised when the window is resized.
event EventHandler<ResizeEventArgs> OnResize
Event Type
OnShow
Raised when the window is shown.
event EventHandler OnShow