Table of Contents

Interface IWindow

Namespace
Lime
Assembly
Lime.dll

Defines the interface for a window.

public interface IWindow

Properties

Active

Indicates whether the window is active. For PC, Mac it means that the window has the input focus. On mobile platforms it indicates that the application is on screen and running.

bool Active { get; }

Property Value

bool

AllowDropFiles

Gets or sets a value indicating whether this IWindow allow files drop.

bool AllowDropFiles { get; set; }

Property Value

bool

AsyncRendering

bool AsyncRendering { get; }

Property Value

bool

ClientPosition

Gets or sets an upper-left corner of the client area on the desktop.

Vector2 ClientPosition { get; set; }

Property Value

Vector2

ClientSize

Gets or sets a client size of this window.

Vector2 ClientSize { get; set; }

Property Value

Vector2

Context

IContext Context { get; set; }

Property Value

IContext

Cursor

Gets or sets the cursor for this window.

MouseCursor Cursor { get; set; }

Property Value

MouseCursor

DecoratedPosition

Gets or sets a position of this window on the desktop.

Vector2 DecoratedPosition { get; set; }

Property Value

Vector2

DecoratedSize

Gets or sets an decorated size (including title and border) of this window.

Vector2 DecoratedSize { get; set; }

Property Value

Vector2

Display

Gets the display device containing the largest portion of this window on desktops or the default screen on devices.

IDisplay Display { get; }

Property Value

IDisplay

FPS

Gets current FPS for the window.

float FPS { get; }

Property Value

float

FixedSize

Gets or sets the window behavior to be resizable or not.

bool FixedSize { get; set; }

Property Value

bool

Form

Form Form { get; }

Property Value

Form

Fullscreen

Gets or sets the fullscreen window state.

bool Fullscreen { get; set; }

Property Value

bool

Input

Gets WindowInput for this window.

WindowInput Input { get; }

Property Value

WindowInput

IsRenderingPhase

Indicates is this window in rendering phase.

bool IsRenderingPhase { get; }

Property Value

bool

MaximumDecoratedSize

Vector2 MaximumDecoratedSize { get; set; }

Property Value

Vector2

MinimumDecoratedSize

Vector2 MinimumDecoratedSize { get; set; }

Property Value

Vector2

PixelScale

Gets the scale factor which translates virtual units to the physical pixels.

float PixelScale { get; }

Property Value

float

SafeAreaInsets

Gets the safe area insets for this window.

Rectangle SafeAreaInsets { get; }

Property Value

Rectangle

State

Gets or sets the window state.

WindowState State { get; set; }

Property Value

WindowState

Tag

object Tag { get; set; }

Property Value

object

Title

Gets or sets the title of the window.

string Title { get; set; }

Property Value

string

UnclampedDelta

Milliseconds since last update.

float UnclampedDelta { get; }

Property Value

float

UpdateMinimized

bool UpdateMinimized { get; set; }

Property Value

bool

VSync

bool VSync { get; set; }

Property Value

bool

Visible

Gets or sets a value indicates whether the window is displayed.

bool Visible { get; set; }

Property Value

bool

Methods

Activate()

Activates this window.

void Activate()

CalcFPS()

[Obsolete("Use FPS property instead", true)]
float CalcFPS()

Returns

float

Center()

Centers the game window on the current display.

void Center()

Close()

Closes this window.

void Close()

DesktopToLocal(Vector2)

Converts desktop coordinates into local window coordinates.

Vector2 DesktopToLocal(Vector2 desktopPosition)

Parameters

desktopPosition Vector2

Returns

Vector2

DragFiles(string[])

Initiate dragging of files supported by native controls

void DragFiles(string[] filenames)

Parameters

filenames string[]

list of paths to files

Invalidate()

Sets a flag indicating whether the current frame should be rendered.

void Invalidate()

InvokeOnRendering(Action)

Executes an action at the rendering phase.

void InvokeOnRendering(Action action)

Parameters

action Action

LocalToDesktop(Vector2)

Converts local window coordinates into desktop coordinates.

Vector2 LocalToDesktop(Vector2 localPosition)

Parameters

localPosition Vector2

Returns

Vector2

ShowModal()

You can use this method to display a modal dialog box in your application. When this method is called, the code following it is not executed until after the dialog box is closed. The window must be hidden before calling this method.

void ShowModal()

WaitForRendering()

void WaitForRendering()

Events

Activated

Occurs when the Active property of the window becomes true.

event Action Activated

Event Type

Action

Closed

Occurs after the window has closed.

event Action Closed

Event Type

Action

Closing

Occurs when the window is about to close. Returns false to cancel closing.

event ClosingDelegate Closing

Event Type

ClosingDelegate

Deactivated

Occurs when the Active property of the window becomes false.

event Action Deactivated

Event Type

Action

FilesDropped

Occurs when files are dropped.

event Action<IEnumerable<string>> FilesDropped

Event Type

Action<IEnumerable<string>>

Moved

Occurs whenever the window is moved.

event Action Moved

Event Type

Action

Rendering

Occurs when it is time to render a frame.

event Action Rendering

Event Type

Action

Resized

Occurs whenever the window is resized or a device orientation has changed.

event ResizeDelegate Resized

Event Type

ResizeDelegate

SafeAreaInsetsChanged

Occurs when safe area insets changed.

event SafeAreaInsetsChangedDelegate SafeAreaInsetsChanged

Event Type

SafeAreaInsetsChangedDelegate

Sync

Occurs after update and before render. One can use this event to perform thread unsafe operations with the window.

event Action Sync

Event Type

Action

UnhandledExceptionOnUpdate

Occurs when unhandled exception on update.

event Action<Exception> UnhandledExceptionOnUpdate

Event Type

Action<Exception>

Updating

Occurs when it is time to update a frame.

event UpdatingDelegate Updating

Event Type

UpdatingDelegate

VisibleChanging

Occurs when the window is about to show or hide.

event VisibleChangingDelegate VisibleChanging

Event Type

VisibleChangingDelegate