Window API
Every option Ember.new accepts, and every method a window has.
Ember.new#
local win = Ember.new({ Title = "My Script" })Everything is optional.
Identity#
| Option | Type | Default | What it does |
|---|---|---|---|
Title | string | — | Shown in the title bar. |
Subtitle | string | — | A smaller second line under the title. |
Icon | string | — | An icon name shown next to the title. |
IconColor | Color3 | — | Overrides that icon's colour. |
Name | string | — | Internal name for the ScreenGui. |
Footer | string | — | Small text at the bottom of the rail. |
Accent | Color3 | — | Overrides the theme's accent for this window only. |
Geometry#
| Option | Type | Default | What it does |
|---|---|---|---|
Size | Vector2 | Vector2.new(700, 452) | Starting size. |
MinSize | Vector2 | Vector2.new(560, 300) | The user cannot resize below this. |
MaxSize | Vector2 | — | Upper limit. Defaults to the viewport. |
Position | Vector2 | UDim2 | — | Where it opens. Centred if unset. |
Rail | number | 176 | Sidebar width in pixels. |
MinRail | number | 132 | Narrowest the sidebar can be dragged. |
MaxRail | number | 320 | Widest the sidebar can be dragged. |
MinContent | number | 300 | The content pane never shrinks past this. |
Resizable | boolean | true | Whether the resize grip is offered. |
SafeArea | boolean | true | Keeps the window inside the usable viewport. |
SaveLayout | boolean | false | Remember size, position and rail width between sessions. |
Behaviour#
| Option | Type | Default | What it does |
|---|---|---|---|
Keybind | EnumItem | string | Enum.KeyCode.RightShift | The key that hides and shows the window. A string like "F4" works too. |
ReplaceExisting | boolean | true | Close this script's previous window instead of stacking a second one. |
Search | boolean | false | Adds a search box to the rail that spans every section. |
SearchPlaceholder | string | — | Ghost text for that box. |
Duration | number | — | Overrides the open and close animation length. |
Sections#
local main = win:Section("Main", "house")
-- with options
local big = win:Section("Everything", "list", {
Search = true,
SearchPlaceholder = "Filter this section…",
})The first section created is the one shown on open.
Methods#
Content#
| Method | What it does |
|---|---|
Section(name, icon, opts) | Adds a tab and returns its page |
Select(section) | Switches to a section |
Notify(opts) | Shows a notification |
ThemeEditor(section) | Drops the full theme editor into a section |
Appearance#
| Method | What it does |
|---|---|
SetTitle(text) | Changes the title |
SetSubtitle(text) | Changes the subtitle |
SetSize(width, height) | Resizes |
SetMinSize(v) / SetMaxSize(v) | Changes the resize limits |
SetPosition(v) | Moves it |
SetRailWidth(n) | Resizes the sidebar |
Centre() / Center() | Centres it on screen. Both spellings work. |
State#
| Method | What it does |
|---|---|
Toggle() | Hides or shows, with the dissolve |
Minimise() / Minimize() | Collapses to the title bar |
SaveLayout() | Writes the current geometry to disk |
RestoreLayout() | Reads it back |
GetLayout() | Returns the current geometry as a table |
Lifecycle#
| Method | What it does |
|---|---|
Destroy() | Tears the window down and disconnects everything |
OnDestroy(fn) | Registers cleanup to run on destroy |
Track(connection) | Hands a connection to the window to disconnect for you |
A fully specified window#
local win = Ember.new({
Title = "Bloxburg Helper",
Subtitle = "v2.1",
Icon = "house",
Footer = "by you",
Size = Vector2.new(760, 500),
MinSize = Vector2.new(600, 340),
Rail = 190,
SaveLayout = true,
Keybind = Enum.KeyCode.RightControl,
Search = true,
})