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
AllowDropFiles
Gets or sets a value indicating whether this IWindow allow files drop.
bool AllowDropFiles { get; set; }
Property Value
AsyncRendering
bool AsyncRendering { get; }
Property Value
ClientPosition
Gets or sets an upper-left corner of the client area on the desktop.
Vector2 ClientPosition { get; set; }
Property Value
ClientSize
Gets or sets a client size of this window.
Vector2 ClientSize { get; set; }
Property Value
Context
IContext Context { get; set; }
Property Value
Cursor
Gets or sets the cursor for this window.
MouseCursor Cursor { get; set; }
Property Value
DecoratedPosition
Gets or sets a position of this window on the desktop.
Vector2 DecoratedPosition { get; set; }
Property Value
DecoratedSize
Gets or sets an decorated size (including title and border) of this window.
Vector2 DecoratedSize { get; set; }
Property Value
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
FPS
Gets current FPS for the window.
float FPS { get; }
Property Value
FixedSize
Gets or sets the window behavior to be resizable or not.
bool FixedSize { get; set; }
Property Value
Form
Form Form { get; }
Property Value
Fullscreen
Gets or sets the fullscreen window state.
bool Fullscreen { get; set; }
Property Value
Input
Gets WindowInput for this window.
WindowInput Input { get; }
Property Value
IsRenderingPhase
Indicates is this window in rendering phase.
bool IsRenderingPhase { get; }
Property Value
MaximumDecoratedSize
Vector2 MaximumDecoratedSize { get; set; }
Property Value
MinimumDecoratedSize
Vector2 MinimumDecoratedSize { get; set; }
Property Value
PixelScale
Gets the scale factor which translates virtual units to the physical pixels.
float PixelScale { get; }
Property Value
SafeAreaInsets
Gets the safe area insets for this window.
Rectangle SafeAreaInsets { get; }
Property Value
State
Gets or sets the window state.
WindowState State { get; set; }
Property Value
Tag
object Tag { get; set; }
Property Value
Title
Gets or sets the title of the window.
string Title { get; set; }
Property Value
UnclampedDelta
Milliseconds since last update.
float UnclampedDelta { get; }
Property Value
UpdateMinimized
bool UpdateMinimized { get; set; }
Property Value
VSync
bool VSync { get; set; }
Property Value
Visible
Gets or sets a value indicates whether the window is displayed.
bool Visible { get; set; }
Property Value
Methods
Activate()
Activates this window.
void Activate()
CalcFPS()
[Obsolete("Use FPS property instead", true)]
float CalcFPS()
Returns
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
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
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
Closed
Occurs after the window has closed.
event Action Closed
Event Type
Closing
Occurs when the window is about to close. Returns false to cancel closing.
event ClosingDelegate Closing
Event Type
Deactivated
Occurs when the Active property of the window becomes false.
event Action Deactivated
Event Type
FilesDropped
Occurs when files are dropped.
event Action<IEnumerable<string>> FilesDropped
Event Type
Moved
Occurs whenever the window is moved.
event Action Moved
Event Type
Rendering
Occurs when it is time to render a frame.
event Action Rendering
Event Type
Resized
Occurs whenever the window is resized or a device orientation has changed.
event ResizeDelegate Resized
Event Type
SafeAreaInsetsChanged
Occurs when safe area insets changed.
event SafeAreaInsetsChangedDelegate SafeAreaInsetsChanged
Event Type
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
UnhandledExceptionOnUpdate
Occurs when unhandled exception on update.
event Action<Exception> UnhandledExceptionOnUpdate
Event Type
Updating
Occurs when it is time to update a frame.
event UpdatingDelegate Updating
Event Type
VisibleChanging
Occurs when the window is about to show or hide.
event VisibleChangingDelegate VisibleChanging