CreateWindow

Syntax

Lib:CreateWindow({Title = "Window Name", Size = {x, y}, Resizable = bool})

Every parameter besides Title is optional.

These parameters can optionally be added to the parameter list to tweak window behavior.

  • <string> Title - Sets the window's name.

  • <string> Index - Sets the window's index. If this is not passed, the library uses Title.

  • <string> ToggleKey - Sets window's default toggle key. Format: [KEY] (key list)

  • <RGB table> FontColor - Sets the window's font color.

  • <RGB table> MainColor - Sets the window's main color.

  • <RGB table> BackgroundColor - Sets the window's background color.

  • <RGB table> AccentColor - Sets the window's accent color.

  • <RGB table> OutlineColor - Sets the window's outline color.

  • <X,Y table> Size - Sets the window's default size.

  • <X,Y table> StartLocation - Sets the window's start location.

  • <bool> Rainbow - Enables color-changing accents.

  • <bool> Resizable - Determines whether the user can resize window.

  • <bool> FooterToggle - Determines whether the footer toggle bind is displayed.

  • <bool> FooterRGB - Determines whether the footer RGB bind is displayed.

  • <bool> FooterMouseCoords - Determines whether the footer mouse coords are displayed.

Notes

  • Every parameter besides Title is optional. If a value is left out, it will use a default preset.

  • Each window title must be unique if an Index variable isn't used or errors will occur.

  • All of the footer elements such as Footer Toggle, Footer RGB, and Footer Mouse Coords will be true by default unless specified otherwise.

  • A lot of the window variables constantly need to be changed by the script for it to function, so don't recursively change them or it may break the window.

Example

Code shown below is missing some critical syntax for simplicity

--// Creating Window
local Window = Lib:CreateWindow({Index = "window_1", Title = "Test Window", Size = {300, 500}, Resizable = true, FooterMouseCoords = false})

--// Making a button to hide window
Groupbox:AddButton("Hide Window", function()
    Window.Active = false
end)

--// Making a button to double window size
Groupbox:AddButton("Double Window Size", function()
    Window.Size = {Window.Size[1] * 2, Window.Size[2] * 2}
end)
Window Demo

FAQ

When I click window elements, another window is affected.

If the windows aren't stacked, the issue is most likely caused by both of the windows having the same name. If you need the name to be the same, pass an Index variable when initiating each of the windows with each index being unique.

Last updated