Window
A top-level native window. Create its content, then set Visible to true to show it.
Create: Instance.new("Window", {...}). Inherits: Instance.
Parent and children: Top-level window; do not give it a Parent. It can own child content.
Example
Section titled “Example”Where to put it: replace Src/Main.luau in a project created with this SDK. This is the complete entry file.
local Window = Instance.new("Window", { Title = "My app", Size = UDim2.fromOffset(560, 280),})Window.Visible = trueExpected result: A window titled My app opens. Visible starts false, so the last line matters.
Properties
Section titled “Properties”Text shown in the native window title bar.
Type: string. Default: empty string. Read/write field.
Visible
Section titled “Visible”Shows or hides the native window. Create the content first, then set this to true.
Type: boolean. Default: false. Read/write field.
IsClosed
Section titled “IsClosed”Whether the native window has reached its closed state. This is a terminal lifetime state, not the inverse of Visible.
Type: boolean. Default: false; terminal native lifetime. Read-only.
Requested window size in logical units. Use an offset size for a top-level window, which has no parent viewport.
Type: UDim2. Default: 800x600. Read/write field.
AbsolutePosition
Section titled “AbsolutePosition”The origin of the window’s shared layout, (0, 0). It is not the native window’s position on the desktop.
Type: Vector2. Default: derived. Read-only.
AbsoluteSize
Section titled “AbsoluteSize”The resolved window size. It can differ from the size you originally requested after native resizing.
Type: Vector2. Default: derived. Read-only.
Methods
Section titled “Methods”RequestClose
Section titled “RequestClose”Requests normal window closure, including CloseRequested handlers. Returns whether the request was accepted and an optional refusal reason. It is not unconditional destruction.
RequestClose() -> (boolean, string?)PreventClose
Section titled “PreventClose”Refuses the current close decision when called inside CloseRequested. It returns false outside an active close decision.
PreventClose() -> booleanSignals
Section titled “Signals”Shortcut
Section titled “Shortcut”Receives an unhandled keyboard shortcut, including modifier and text-editing flags. It is not a global hotkey and cannot capture another application’s input.
Type: ShortcutSignal. Subscribe with :Connect(function(...) ... end).
CloseRequested
Section titled “CloseRequested”Fires before normal native closure. Call PreventClose here when the user needs to save edits first. No arguments are passed.
Type: Signal. Subscribe with :Connect(function(...) ... end).
Closed
Section titled “Closed”Fires when native closure completes. No arguments are passed. Closure is distinct from Destroy: retained child Instances can still exist, so explicitly destroy the tree or reparent content when its app lifetime ends.
Type: Signal. Subscribe with :Connect(function(...) ... end).
Inherited members
Section titled “Inherited members”You can use these directly on Window. Follow a member link for its explanation and example.
From Instance
Section titled “From Instance”Name · Sensitive · EffectiveSensitive · Parent · ClassName · Destroy · Clone · GetChildren · GetDescendants · FindFirstChild · IsA · Changed · Destroying
Full type declaration — for type checking and deeper reference
The declaration is generated from the SDK. Self is supplied by a colon call; read means the field cannot be assigned. See how to read this reference.
export type Window = Instance & { Title: string, Visible: boolean, read IsClosed: boolean, Size: UDim2, read AbsolutePosition: Vector2, read AbsoluteSize: Vector2, read RequestClose: (Self: Window) -> (boolean, string?), read PreventClose: (Self: Window) -> boolean, read Shortcut: ShortcutSignal, read CloseRequested: Signal, read Closed: Signal,}Availability and deeper reading
Section titled “Availability and deeper reading”See platform limits before relying on host-specific behavior. The framework design specification and reflection/type sources are deeper engineering references, not extra setup required to build an app.