### InputInt Usage Example (Lua) Source: https://depso.gitbook.io/regui/elements/inputint Demonstrates how to create and configure an InputInt element in Lua. This example shows setting a label, initial value, and defining maximum and minimum limits for the input. ```lua :InputInt({ Label = "InputInt (w/ limit)", Value = 5, Maximum = 10, Minimum = 1 }) ``` -------------------------------- ### Example Usage of Label Component (TypeScript) Source: https://depso.gitbook.io/regui/elements/label Demonstrates how to use the Label component with sample text. This example shows a basic instantiation of the component, setting the 'Text' property to 'Hello world!'. ```typescript :Label({ Text = "Hello world!" }) ``` -------------------------------- ### InputTextMultiline Usage Example (Lua) Source: https://depso.gitbook.io/regui/elements/inputtextmultiline Demonstrates how to use the InputTextMultiline component in a Lua environment. This example shows the basic initialization of the component with a default 'Value'. ```lua :InputTextMultiline({ Value = "Hello world!" }) ``` -------------------------------- ### Lua Example Usage for DragInt Source: https://depso.gitbook.io/regui/elements/dragint Demonstrates how to create and configure a DragInt component using Lua. This example shows setting the minimum and maximum values, as well as a descriptive label for the component. It serves as a practical guide for implementing the DragInt UI element in a Lua environment. ```lua :DragInt({ Maximum = 100, Minimum = 0, Label = "Drag Int 0..100" }) ``` -------------------------------- ### Example Usage of InputText (Lua) Source: https://depso.gitbook.io/regui/elements/inputtext Demonstrates how to use the :InputText component in Lua. This example shows the creation of an input text field with a label and an initial value. ```lua :InputText({ Label = "Input text", Value = "Hello world!" }) ``` -------------------------------- ### Regui Combo Lua Usage Examples Source: https://depso.gitbook.io/regui/elements/combo Demonstrates how to implement the Regui Combo component using Lua. Examples cover initializing the combo box with data from an array, a dictionary, and a function that dynamically retrieves items. ```lua --// Array :Combo({ Label = "Combo", Selected = "AAAA", Items = { "AAAA", "BBBB", "CCCC" } }) --// Dict :Combo({ Label = "Combo", Selected = "Apple", Items = { Apple = "AAA", Banana = "BBB", Orange = "CCC", }, }) --// Function :Combo({ Label = "Combo", Selected = "aaa", GetItems = function() return { "aaa", "bbb", "ccc", } end, }) ``` -------------------------------- ### Viewport Instantiation and Rotation Example (Lua) Source: https://depso.gitbook.io/regui/elements/viewport Demonstrates how to create and configure a Viewport instance using Lua, including setting its size and model. It further provides an example of dynamically rotating the contained model using the RenderStepped event, showcasing real-time manipulation capabilities. ```lua -- Instantiate Viewport :Viewport({ Size = UDim2.new(1, 0, 0, 200), Clone = true, Model = workspace.Rig }) --// Rotate example local Model = Viewport.Model local RunService = game:GetService("RunService") RunService.RenderStepped:Connect(function(DeltaTime) local Rotation = CFrame.Angles(0, math.rad(30*DeltaTime), 0) local Pivot = Model:GetPivot() * Rotation Model:PivotTo(Pivot) end) ``` -------------------------------- ### CollapsingHeader Lua Example Usage Source: https://depso.gitbook.io/regui/elements/collapsingheader Demonstrates how to instantiate and use the CollapsingHeader component within a Lua environment. This example shows basic initialization and setting a label, implying interaction with a UI canvas. ```lua local CollapsingHeader = ...:CollapsingHeader() --> Canvas CollapsingHeader:Label({Text="Hello world!"}) ``` -------------------------------- ### Radiobox Example Usage (TypeScript) Source: https://depso.gitbook.io/regui/elements/radiobox Demonstrates how to instantiate and configure a :Radiobox component. This example shows setting the initial 'Value' to true, providing a 'Label', and defining a 'Callback' function that prints the ticked status when the radiobox state changes. ```typescript :Radiobox({ Value = true, Label = "Check box", Callback = function(self, Value: boolean) print("Ticked", Value) end }) ``` -------------------------------- ### SliderProgress Lua Example Usage Source: https://depso.gitbook.io/regui/elements/sliderprogress Demonstrates how to use the SliderProgress component in Lua. This example shows how to initialize the component with a label, current value, and minimum/maximum range. ```lua :SliderProgress({ Label = "Progress Slider", Value = 8, Minimum = 1, Maximum = 32, }) ``` -------------------------------- ### SmallButton Example Usage with Callback Source: https://depso.gitbook.io/regui/elements/smallbutton Demonstrates how to use the SmallButton component by providing text and an inline callback function. The example shows a button labeled 'Print' that triggers a 'Hello world!' message when clicked. This illustrates the dynamic behavior possible with the Callback property. ```typescript :SmallButton({ Text = "Print", Callback = function(self) print("Hello world!") end }) ``` -------------------------------- ### Example SliderCFrame Initialization (Lua) Source: https://depso.gitbook.io/regui/elements/slidercframe Demonstrates how to create and initialize a SliderCFrame component using Lua. This example shows setting the initial 'Value' to a new CFrame and assigning a 'Label' for UI display. ```lua :SliderColor3({ Value = CFrame.new(1, 1, 1), Label = "CFrame slider!" }) ``` -------------------------------- ### Example Usage of Button Component Source: https://depso.gitbook.io/regui/elements/button Demonstrates how to instantiate and use the Button component. It shows setting the 'Text' property to 'Print' and defining a 'Callback' function that outputs 'Hello world!' when executed. This example illustrates a basic interactive button. ```typescript :Button({ Text = "Print", Callback = function(self) print("Hello world!") end }) ``` -------------------------------- ### ReGui Code Editor Integration Example (Lua) Source: https://depso.gitbook.io/regui/elements/code-editor Provides a practical example of initializing and integrating the ReGui Code Editor into a ReGui UI. It shows how to create a tab, instantiate the editor with custom properties, and apply ReGui flags to style and manage the editor's GUI element. ```lua local EditorTab = TabSelector:CreateTab({ Name = "Editor" }) --> Canvas local CodeEditor = IDEModule.CodeFrame.new({ Editable = false, FontSize = 13, Colors = SyntaxColors, FontFace = TextFont }) --// Parent and apply custom ReGui properties ReGui:ApplyFlags({ Object = CodeEditor.Gui, WindowClass = Window, Class = { --Border = true, Fill = true, Active = true, Parent = EditorTab:GetObject(), -- Canvas function BackgroundTransparency = 1, } }) ``` -------------------------------- ### PopupModal Usage Example (Lua) Source: https://depso.gitbook.io/regui/elements/popupmodal Demonstrates how to create and configure a PopupModal in Lua, including adding labels, separators, checkboxes, and buttons with callbacks. The example shows how to set the modal title and content, and handle button actions like closing the modal. ```lua local ModalWindow = ...:PopupModal({ Title = "Delete?" }) --> Canvas ModalWindow:Label({ Text = "All those beautiful files will be deleted.\nThis operation cannot be undone!", TextWrapped = true }) ModalWindow:Separator() ModalWindow:Checkbox({ Value = false, Label = "Don't ask me next time" }) local Row = ModalWindow:Row({ Expanded = true }) --> Canvas Row:Button({ Text = "Okay", Callback = function() ModalWindow:ClosePopup() end, }) Row:Button({ Text = "Cancel", Callback = function() ModalWindow:ClosePopup() end, }) ``` -------------------------------- ### Regui Console Component Initialization Example (Lua) Source: https://depso.gitbook.io/regui/elements/console Demonstrates how to initialize and configure the Regui Console component using Lua. This example shows a basic instantiation with the 'LineNumbers' property set to true. It highlights the declarative approach to setting component properties in Regui. ```lua :Console({ LineNumbers = true }) ``` -------------------------------- ### Lua Example Usage for Window Component Source: https://depso.gitbook.io/regui/elements/window Demonstrates how to instantiate and use the Window component in Lua. It shows creating a new window with a title and size, and then adding a label to it. Assumes the existence of `UDim2` and `Window:Label` constructor. ```lua -- Create a new window with a title and size :Window({ Title = "Hello world!", Size = UDim2.fromOffset(300, 200) }) --> Canvas -- Add a label to the newly created canvas Window:Label({ Text = "Hello world!" }) ``` -------------------------------- ### Example DragFloat Usage in Lua Source: https://depso.gitbook.io/regui/elements/dragfloat Demonstrates how to instantiate and use a DragFloat element in Lua. The example shows setting the Maximum, Minimum, and initial Value properties. ```lua :DragFloat({ Maximum = 1, Minimum = 0, Value = 0.5 }) ``` -------------------------------- ### Checkbox Component Usage Example (TypeScript) Source: https://depso.gitbook.io/regui/elements/checkbox Demonstrates how to instantiate and configure a Checkbox component. This example shows setting the initial value, adding a label, and defining a callback function to handle state changes. ```typescript :Checkbox({ Value = true, Label = "Check box", Callback = function(self, Value: boolean) print("Ticked", Value) end }) ``` -------------------------------- ### Regui Separator Example Usage (Lua) Source: https://depso.gitbook.io/regui/elements/separator Demonstrates how to use the Separator component in Lua. The examples show how to instantiate the separator with and without accompanying text. This functionality relies on the Regui framework's component system. ```lua -- With text :Separator({Text="Separator"}) -- Only line :Separator() ``` -------------------------------- ### TreeNode Initialization Example (Lua) Source: https://depso.gitbook.io/regui/elements/treenode Demonstrates how to instantiate and use a TreeNode object in Lua. This example shows creating a TreeNode and then adding a label to it, likely within a graphical user interface context. ```lua local TreeNode = ...:TreeNode() --> Canvas TreeNode:Label({Text="Hello world!"}) ``` -------------------------------- ### Create a basic window with UI elements in ReGui Source: https://depso.gitbook.io/regui/getting-started/creating-windows This snippet demonstrates how to create a simple ReGui window with a title, size, and includes examples of adding labels, buttons, input text fields, and sliders. It assumes the ReGui library is initialized and available. ```lua local Window = ReGui:Window({ Title = "Hello world!", Size = UDim2.fromOffset(300, 200) }) --> Canvas & WindowClass Window:Label({Text="Hello, world!"}) Window:Button({ Text = "Save", Callback = function() MySaveFunction() end, }) Window:InputText({Label="string"}) Window:SliderFloat({Label = "float", Minimum = 0.0, Maximum = 1.0}) ``` -------------------------------- ### SliderFloat Lua Example Usage Source: https://depso.gitbook.io/regui/elements/sliderfloat Demonstrates how to use the SliderFloat component in Lua. This example shows setting the label, minimum and maximum values, an initial value, and a custom format string for the displayed float. ```lua :SliderFloat({ Label = "Slider Float", Minimum = 0.0, Maximum = 1.0, Value = 0.5, Format = "Ratio = %.3f" }) ``` -------------------------------- ### Lua Example Usage of Keybind Source: https://depso.gitbook.io/regui/elements/keybind Demonstrates how to create and configure a Keybind object in Lua. It shows setting a label, a key value, and defining callback functions for when the keybind is set or triggered. ```lua :Keybind({ Label = "Toggle checkbox", Value = Enum.KeyCode.Q, OnKeybindSet = function(self, KeyId) warn("[OnKeybindSet] .Value ->", KeyId) end, Callback = function(self, KeyId) print(KeyId) TestCheckbox:Toggle() end, }) ``` -------------------------------- ### Table Component Lua Example Usage Source: https://depso.gitbook.io/regui/elements/table Demonstrates how to use the Table component in Lua to create a table with multiple columns and add labels to them. This example shows the basic instantiation and manipulation of table elements. ```lua local Table = ...:Table() local Row = Table:Row() local Column1 = Row:Column() --> Canvas Column1:Label({Text="Column 1!"}) local Column2 = Row:Column() --> Canvas Column2 :Label({Text="Column 2!"}) ``` -------------------------------- ### Lua Example Usage of PlotHistogram Source: https://depso.gitbook.io/regui/elements/plothistogram Demonstrates how to use the PlotHistogram functionality in Lua. The examples show the creation of a PlotHistogram with a set of points, and also how to specify minimum and maximum boundaries for the histogram. ```lua :PlotHistogram({ Points = {0.6, 0.1, 1.0, 0.5, 0.92, 0.1, 0.2} }) --// With limited sizes :PlotHistogram({ Minimum = 0, Maximum = 1, Points = {0.6, 0.1, 1.0, 0.5, 0.92, 0.1, 0.2} }) ``` -------------------------------- ### Example Usage of Code Editor Source: https://depso.gitbook.io/regui/elements/code-editor Demonstrates how to create and configure a Code Editor instance, parenting it to the UI and applying custom ReGui properties. ```APIDOC ## Example Usage of Code Editor ### Description This example shows how to create a new Code Editor instance, set its initial properties, and integrate it into a ReGui UI, including parenting and applying custom window class properties. ### Code Example ```lua local EditorTab = TabSelector:CreateTab({ Name = "Editor" }) --> Canvas local CodeEditor = IDEModule.CodeFrame.new({ Editable = false, FontSize = 13, Colors = SyntaxColors, FontFace = TextFont }) --// Parent and apply custom ReGui properties ReGui:ApplyFlags({ Object = CodeEditor.Gui, WindowClass = Window, Class = { --Border = true, Fill = true, Active = true, Parent = EditorTab:GetObject(), -- Canvas function BackgroundTransparency = 1, } }) ``` ``` -------------------------------- ### BulletText Example Usage (Lua) Source: https://depso.gitbook.io/regui/elements/bullettext Demonstrates how to use the BulletText structure in Lua. This example shows how to define rows of text within the BulletText object. ```lua :BulletText({ Rows = { "This is point 1", "This is point 2" } }) ``` -------------------------------- ### Example Usage of :DragCFrame (Lua) Source: https://depso.gitbook.io/regui/elements/dragcframe Demonstrates how to use the :DragCFrame function in Lua. This example shows setting initial values for the CFrame and its label. This is a common pattern for initializing UI elements that require CFrame data. ```lua :DragCFrame({ Value = CFrame.new(1, 1, 1), Label = "Color 1" }) ``` -------------------------------- ### Row Component Usage Example (Lua) Source: https://depso.gitbook.io/regui/elements/row Demonstrates how to use the :Row component in Lua, specifically to create a label with the text 'Hello world!' within a canvas context. ```lua :Row() --// Canvas Row:Label({ Text = "Hello world!" }) ``` -------------------------------- ### Example InputColor3 Usage (Lua) Source: https://depso.gitbook.io/regui/elements/inputcolor3 This Lua code snippet demonstrates how to create and initialize an InputColor3 component. It sets the initial value to white and assigns a label 'Color 1'. This is a practical example of implementing the InputColor3 type. ```lua :InputColor3({ Value = Color3.fromRGB(255,255,255), Label = "Color 1" }) ``` -------------------------------- ### Example Usage of SliderCFrame Source: https://depso.gitbook.io/regui/elements/slidercframe Demonstrates how to instantiate and use a SliderCFrame with specific properties like Value and Label. ```APIDOC ## Example Usage: Creating a CFrame Slider ### Description This example shows a practical implementation of how to create a `SliderCFrame` instance in Lua. It initializes the slider with a specific CFrame value and assigns a descriptive label. ### Method Lua Function Call ### Code Example ```lua :SliderColor3({ Value = CFrame.new(1, 1, 1), Label = "CFrame slider!" }) ``` ### Notes - The `:SliderColor3` is likely a factory function or constructor for creating slider components. The provided example uses `SliderCFrame`'s properties. ``` -------------------------------- ### SliderEnum Example Usage (Lua) Source: https://depso.gitbook.io/regui/elements/sliderenum Demonstrates how to instantiate and configure a SliderEnum component in Lua. It shows setting the items, initial value (as an index), and a label for the slider. ```lua :SliderEnum({ Items = {"Fire", "Earth", "Air", "Water"}, Value = 2, -- Index Label = "Item" }) ``` -------------------------------- ### SliderFloat Example Usage Source: https://depso.gitbook.io/regui/elements/sliderfloat Demonstrates how to use the SliderFloat component in Lua, showing how to instantiate it with a label, range, initial value, and display format. ```APIDOC ## SliderFloat Example Usage ### Description Provides a practical example of how to implement the `:SliderFloat` component in a Lua environment. This snippet illustrates setting the label, minimum and maximum values, initial value, and the desired number format. ### Method * Call the `:SliderFloat` constructor with a table of configuration options. ### Endpoint N/A (Client-side component usage) ### Parameters (Lua Table) * **Label** (string) - The label for the slider (e.g., `"Slider Float"`). * **Minimum** (number) - The minimum value (e.g., `0.0`). * **Maximum** (number) - The maximum value (e.g., `1.0`). * **Value** (number, optional) - The initial value of the slider (e.g., `0.5`). * **Format** (string, optional) - The display format for the value (e.g., `"Ratio = %.3f"`). ### Request Example (Lua) ```lua :SliderFloat({ Label = "Slider Float", Minimum = 0.0, Maximum = 1.0, Value = 0.5, Format = "Ratio = %.3f" }) ``` ### Response N/A (This is a client-side UI component instantiation). ``` -------------------------------- ### TabsWindow Lua Example Usage Source: https://depso.gitbook.io/regui/elements/tabswindow Demonstrates how to create and interact with a TabsWindow using Lua. It shows the instantiation of a new TabsWindow with basic properties and how to create and add a label to a tab. ```lua --:TabsWindow({ -- Title = "Hello world!", -- Size = UDim2.fromOffset(300, 200) --}) --> TabSelector & Window (Merged metatables) ----// Create Tab --local Tab = TabsWindow:CreateTab({ -- Name="Tab" --}) --> Canvas --Tab:Label({ -- Text = "Hello world!" --}) ``` -------------------------------- ### Bullet Component Usage Example (Lua) Source: https://depso.gitbook.io/regui/elements/bullet Demonstrates how to use the Bullet component in Lua. The example shows how to create a label within the Bullet component and set its text content. This is useful for UI development in environments that support this Lua API. ```lua :Bullet() --// Canvas Bullet:Label({ Text = "Hello world!" }) ``` -------------------------------- ### TabSelector Example Usage (Lua) Source: https://depso.gitbook.io/regui/elements/tabselector Demonstrates how to use the TabSelector component in Lua to dynamically create and configure tabs. It shows the instantiation of TabSelector, iteration through names to create new tabs, and adding labels to each tab. ```lua local TabSelector = ...:TabSelector() local Names = {"Avocado", "Broccoli", "Cucumber"} for _, Name in Names do local Tab = TabSelector:CreateTab({Name = Name}) --> Canvas Tab:Label({ Text = `This is the {Name} tab!` }) end ``` -------------------------------- ### Load ReGui for Executors via HTTP (Lua) Source: https://depso.gitbook.io/regui/getting-started/installing This code snippet shows how to load the ReGui library for use with executors by fetching it directly from a GitHub raw content URL using `game:HttpGet` and `loadstring`. This method avoids local file placement. ```lua local ReGui = loadstring(game:HttpGet('https://raw.githubusercontent.com/depthso/Dear-ReGui/refs/heads/main/ReGui.lua'))() ``` -------------------------------- ### Example SliderColor3 Usage (Lua) Source: https://depso.gitbook.io/regui/elements/slidercolor3 Demonstrates how to instantiate and use the SliderColor3 type in Lua. It shows setting the initial Value and Label properties for a color slider. ```lua :SliderColor3({ Value = Color3.fromRGB(255,255,255), Label = "Color slider!" }) ``` -------------------------------- ### Regui DragColor3 Example Usage (Lua) Source: https://depso.gitbook.io/regui/elements/dragcolor3 Demonstrates how to instantiate and use the DragColor3 component in Lua. It shows setting initial properties like Value and Label for a color picker. ```lua :DragColor3({ Value = Color3.fromRGB(255,255,255), Label = "Color 1" }) ``` -------------------------------- ### TabsWindow Component Source: https://depso.gitbook.io/regui/elements/tabswindow Provides a comprehensive overview of the TabsWindow component, detailing its properties, methods, and how to use it in your project. It includes a TypeScript type definition and Lua code examples for creating and managing tabs within a window. ```APIDOC ## TabsWindow Component ### Description The TabsWindow component allows for the creation of tabbed interfaces within a resizable and collapsible window. It supports various customization options for appearance and behavior. ### Type Definition (TypeScript) ```typescript type TabsWindow = { AutoSize: string?, CloseCallback: (Window) -> boolean?, Collapsed: boolean?, IsDragging: boolean?, MinSize: Vector2?, Theme: any?, Title: string?, NoTabs: boolean?, NoMove: boolean?, NoGradients: boolean?, NoResize: boolean?, NoTitleBar: boolean?, NoClose: boolean?, NoCollapse: boolean?, NoScrollBar: boolean?, NoSelectEffect: boolean?, NoFocusOnAppearing: boolean?, NoDefaultTitleBarButtons: boolean?, NoWindowRegistor: boolean?, OpenOnDoubleClick: boolean?, SetTheme: (Window, ThemeName: string) -> Window, SetTitle: (Window, Title: string) -> Window, UpdateConfig: (Window, Config: table) -> Window, SetCollapsed: (Window, Collapsed: boolean, NoAnimation: boolean?) -> Window, SetCollapsible: (Window, Collapsible: boolean) -> Window, SetFocused: (Window, Focused: boolean) -> Window, Center: (Window) -> Window, SetVisible: (Window, Visible: boolean) -> Window, TagElements: (Window, Objects: { [GuiObject]: string }) -> nil, Close: (Window) -> nil, } ``` ### Example Usage (Lua) ```lua -- Create a TabsWindow local myTabsWindow = :TabsWindow({ Title = "Hello world!", Size = UDim2.fromOffset(300, 200) }) -- Create a new tab local myTab = TabsWindow:CreateTab({ Name="Tab" }) -- Add a label to the tab myTab:Label({ Text = "Hello world!" }) ``` ### Theme Colors | Tag | Affects | |---|---| | WindowBg | Background color | | WindowBgTransparency | Background transparency | | TitleBarBgCollapsed | Background color of collapsed titlebar | | TitleBarTransparencyCollapsed | Background transparency of collapsed titlebar | | TitleBarBgActive | Background color of active titlebar | | TitleBarTransparencyActive | Background transparency of active titlebar | | TitleBarBg | Background color of in-active titlebar | | TitleBarTransparency | Background transparency of in-active titlebar | | Border | Color of border | | BorderTransparency | Transparency of in-active border | | BorderTransparencyActive | Transparency of active border | | ResizeGrab | Color of resize grab | ``` -------------------------------- ### Require ReGui in Roblox Games (Lua) Source: https://depso.gitbook.io/regui/getting-started/installing This code snippet demonstrates how to require the ReGui library in a Roblox game. It assumes ReGui has been placed in ReplicatedStorage. This is typically used within a LocalScript. ```lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local ReGui = require(ReplicatedStorage.ReGui) ``` -------------------------------- ### Regui Console Component Type Definition (TypeScript) Source: https://depso.gitbook.io/regui/elements/console Defines the structure and types for the Regui Console component in TypeScript. It outlines properties like Enabled, ReadOnly, Value, RichText, TextWrapped, LineNumbers, AutoScroll, MaxLines, and methods for updating, setting values, getting values, clearing, appending text, and checking line counts. This definition serves as a blueprint for the console's behavior and data structure. ```typescript type Console = { Enabled: boolean?, ReadOnly: boolean?, Value: string?, RichText: boolean?, TextWrapped: boolean?, LineNumbers: boolean?, AutoScroll: boolean, LinesFormat: string, MaxLines: number, UpdateLineNumbers: (Console) -> Console, UpdateScroll: (Console) -> Console, SetValue: (Console, Value: string) -> Console, GetValue: (Console) -> string, Clear: (Console) -> Console, AppendText: (Console, ...string) -> Console, CheckLineCount: (Console) -> Console } ``` -------------------------------- ### Create InputCFrame Component (Lua) Source: https://depso.gitbook.io/regui/elements/inputcframe Demonstrates how to create an InputCFrame component using Lua. It shows setting initial values for Value, Minimum, and Maximum CFrames. The Callback function is commented out but can be used for event handling. ```lua :InputCFrame({ Value = CFrame.new(1,1,1), Minimum = CFrame.new(0,0,0), Maximum = CFrame.new(200, 100, 50), --Callback = print }) ``` -------------------------------- ### Create a tabbed window with dynamic tabs in ReGui Source: https://depso.gitbook.io/regui/getting-started/creating-windows This snippet shows how to create a ReGui window that includes a tabbed interface. It iterates through a list of names to dynamically create multiple tabs, each containing a label specific to the tab's name. This requires the ReGui library to be set up. ```lua local Window = ReGui:TabsWindow({ Title = "Tabs window demo!", Size = UDim2.fromOffset(300, 200) }) --> TabSelector & WindowClass local Names = {"Avocado", "Broccoli", "Cucumber"} for _, Name in next, Names do --// Create tab local Tab = Window:CreateTab({Name=Name}) --> Canvas Tab:Label({ Text = `This is the {Name} tab!` }) end ``` -------------------------------- ### Importing the Code Editor Source: https://depso.gitbook.io/regui/elements/code-editor Provides instructions on how to import the Code Editor module using either 'require' or 'loadstring'. ```APIDOC ## Importing the Code Editor ### Description This section details the methods for importing the Code Editor module into your project. You can use the standard Lua 'require' function if the module is available locally, or 'loadstring' with an HTTP GET request to fetch it from a remote URL. ### Methods #### Using 'require' ```lua local IDEModule = require(...IDEModule) ``` #### Using 'loadstring' ```lua local IDEModule = loadstring(game:HttpGet('https://raw.githubusercontent.com/depthso/Dear-ReGui/refs/heads/main/lib/ide.lua'))() ``` ``` -------------------------------- ### Create a Custom ReGui Theme (Lua) Source: https://depso.gitbook.io/regui/plugins/custom-themes Demonstrates how to define a new custom theme for ReGui. This involves providing a theme name and a table of color configurations that overwrite the default theme settings. ```lua ReGui:DefineTheme("Pink Theme", { Text = Color3.fromRGB(200, 180, 200), WindowBg = Color3.fromRGB(35, 30, 35), TitleBarBg = Color3.fromRGB(35, 30, 35), TitleBarBgActive = Color3.fromRGB(50, 45, 50), Border = Color3.fromRGB(50, 45, 50), ResizeGrab = Color3.fromRGB(50, 45, 50), }) ``` -------------------------------- ### Importing ReGui Code Editor (Lua) Source: https://depso.gitbook.io/regui/elements/code-editor Demonstrates two methods for importing the ReGui Code Editor module in Lua: using 'require' for local modules and 'loadstring' with 'game:HttpGet' to fetch the script from a URL. Choose the method that best suits your project's module management strategy. ```lua local IDEModule = require(...IDEModule) ``` ```lua local IDEModule = loadstring(game:HttpGet('https://raw.githubusercontent.com/depthso/Dear-ReGui/refs/heads/main/lib/ide.lua'))() ``` -------------------------------- ### ReGui:DumpIni Source: https://depso.gitbook.io/regui/configuration-saving Retrieves the current Ini settings, either as a table or a JSON string. This is useful for saving the configuration state. ```APIDOC ## ReGui:DumpIni ### Description Retrieves the current Ini settings, either as a table or a JSON string. This is useful for saving the configuration state. ### Method N/A (This is a function call within the ReGui environment) ### Endpoint N/A ### Parameters #### Query Parameters - **JsonEncode** (boolean) - Optional - If true, returns the settings as a JSON string. ### Request Example ```lua local settings_table = ReGui:DumpIni() local settings_json = ReGui:DumpIni(true) ``` ### Response #### Success Response - **return value** (table|string) - The Ini settings, either as a Lua table or a JSON string. #### Response Example ```json { "setting1": "value1", "setting2": 123 } ``` ``` -------------------------------- ### Apply a Custom Theme to a ReGui Window (Lua) Source: https://depso.gitbook.io/regui/plugins/custom-themes Shows how to apply a previously defined custom theme to a ReGui window. The theme is specified using the 'Theme' property when creating the window instance. ```lua local Window = ReGui:Window({ Title = "My theme demo", Theme = "Pink Theme", Size = UDim2.fromOffset(300, 200) }) Window:Label({ Text = "Hello, world!" }) ``` -------------------------------- ### Create SliderInt Instance (Lua) Source: https://depso.gitbook.io/regui/elements/sliderint Demonstrates how to create an instance of a SliderInt in Lua, setting essential properties like label, initial value, minimum, and maximum. This function likely utilizes the SliderInt type definition. ```lua --- SliderInt({...}) -- Create a slider -- @param opts table -- @return Slider -- Example: -- :SliderInt({ -- Label = "Slider", -- Value = 5, -- Minimum = 1, -- Maximum = 32, -- }) :SliderInt({ Label = "Slider", Value = 5, Minimum = 1, Maximum = 32, }) ``` -------------------------------- ### ReGui:LoadIni Source: https://depso.gitbook.io/regui/configuration-saving Loads new Ini settings into the ReGui Elements. This function can accept settings as either a Lua table or a JSON string. ```APIDOC ## ReGui:LoadIni ### Description Loads new Ini settings into the ReGui Elements. This function can accept settings as either a Lua table or a JSON string. ### Method N/A (This is a function call within the ReGui environment) ### Endpoint N/A ### Parameters #### Request Body - **NewSettings** (table|string) - Required - The new Ini settings to load. Can be a Lua table or a JSON string. - **JsonEncoded** (boolean) - Optional - If true, indicates that `NewSettings` is a JSON string. ### Request Example ```lua local new_config_table = { setting1 = "new_value", setting2 = 456 } ReGui:LoadIni(new_config_table) local new_config_json = '{"setting1": "json_value", "setting2": 789}' ReGui:LoadIni(new_config_json, true) ``` ### Response #### Success Response No explicit return value. Settings are applied directly to Elements. #### Response Example N/A ``` -------------------------------- ### GUI Object Manipulation Source: https://depso.gitbook.io/regui/regui-functions Utilities for interacting with GUI objects, including finding children and setting properties. ```APIDOC ## ReGui:GetChildOfClass ### Description Returns a child instance with a matching ClassName, otherwise it will create one. ### Method `ReGui:GetChildOfClass(Object: GuiObject, ClassName: string): GuiObject` ### Parameters * **Object** (GuiObject) - Required - The parent GUI object to search within. * **ClassName** (string) - Required - The class name of the child to find or create. ### Returns * **GuiObject** - The found or newly created child object. ## ReGui:SetProperties ### Description Apply properties from a dictionary and without producing errors if they cannot be applied. ### Method `ReGui:SetProperties(Object: Instance, Properties: table)` ### Parameters * **Object** (Instance) - Required - The object to set properties on. * **Properties** (table) - Required - A table containing the properties to apply. ## ReGui:ApplyFlags ### Description Like :SetProperties, this function checks ReGui.Flags for a function connected to that property key. Custom flags are [documented here](https://depso.gitbook.io/regui/plugins/custom-flags). Class is the properties table. ### Method `ReGui:ApplyFlags({ Object: Instance, Class: table, WindowClass: table? })` ### Parameters * **Object** (Instance) - Required - The object to apply flags to. * **Class** (table) - Required - The table containing properties and potentially flag keys. * **WindowClass** (table?) - Optional - A window class associated with the object. ## ReGui:InsertPrefab ### Description Returns a copy of an object from the prefabs folder that matches the name. ### Method `ReGui:InsertPrefab(Name: string, Properties): GuiObject` ### Parameters * **Name** (string) - Required - The name of the prefab to insert. * **Properties** (table) - Required - Properties to apply to the inserted prefab. ### Returns * **GuiObject** - A copy of the specified prefab with applied properties. ``` -------------------------------- ### Window Focus Management Source: https://depso.gitbook.io/regui/regui-functions Functions for controlling and querying window focus states. ```APIDOC ## ReGui:SetWindowFocusesEnabled ### Description Determines whether Window focuses should update. ### Method `ReGui:SetWindowFocusesEnabled(Enabled: boolean)` ### Parameters * **Enabled** (boolean) - Required - Determines if window focus updates are enabled. ## ReGui:GetFocusedWindow ### Description Returns the Window with an active focus. ### Method `ReGui:GetFocusedWindow(): WindowClass?` ### Returns * **WindowClass?** - The currently focused window object, or nil if none is focused. ## ReGui:SetFocusedWindow ### Description Sets the currently focused window. ### Method `ReGui:SetFocusedWindow(WindowClass: table?)` ### Parameters * **WindowClass** (table?) - Optional - The window object to set as focused. ## ReGui:WindowCanFocus ### Description Checks if the Window can be brought into focus. ### Method `ReGui:WindowCanFocus(WindowClass: table): boolean` ### Parameters * **WindowClass** (table) - Required - The window object to check for focus capability. ### Returns * **boolean** - True if the window can be focused, false otherwise. ``` -------------------------------- ### Console API Source: https://depso.gitbook.io/regui/elements/console Defines the structure and methods available for the Console object. This includes properties for appearance and behavior, as well as functions for interacting with the console's content. ```APIDOC ## Console Object ### Description Represents a console interface with configurable properties and methods for text manipulation and display. ### Properties - **Enabled** (boolean?) - Indicates if the console is enabled. - **ReadOnly** (boolean?) - Determines if the console is read-only. - **Value** (string?) - The current text content of the console. - **RichText** (boolean?) - Enables or disables rich text formatting. - **TextWrapped** (boolean?) - Enables or disables text wrapping. - **LineNumbers** (boolean?) - Toggles the display of line numbers. - **AutoScroll** (boolean) - Controls whether the console auto-scrolls. - **LinesFormat** (string) - Specifies the format for line numbers. - **MaxLines** (number) - Sets the maximum number of lines to display. ### Methods - **UpdateLineNumbers** (Console) -> Console - Updates the line numbers of the console. - **UpdateScroll** (Console) -> Console - Updates the scroll position of the console. - **SetValue** (Console, Value: string) -> Console - Sets the text value of the console. - **GetValue** (Console) -> string - Retrieves the current text value of the console. - **Clear** (Console) -> Console - Clears the content of the console. - **AppendText** (Console, ...string) -> Console - Appends text to the console. - **CheckLineCount** (Console) -> Console - Checks and potentially adjusts the line count. ### Example Usage ```lua :Console({ LineNumbers = true }) ``` ### Theme Colors #### Description Allows customization of the console's visual theme. #### Parameters ##### Theme Color Tags - **ConsoleLineNumbers** (color) - Affects the color of the line numbers. - **TextFont** (font) - Affects the font of line numbers and text content. - **TextSize** (size) - Affects the font size of line numbers and text content. ``` -------------------------------- ### Theme Colors for Slider Components Source: https://depso.gitbook.io/regui/elements/slidercframe Details the themeable aspects of slider components, specifying which UI elements are affected by different theme color tags. ```APIDOC ## Theme Colors for Slider Components ### Description This section outlines the customizable theme colors applicable to slider components. It provides a mapping between theme tags and the specific UI elements they modify, allowing for consistent visual styling across the application. ### Theme Color Table | Tag | Affects | | ------------------- | ----------------------- | | FrameBg | Background color | | FrameBgTransparency | Background transparency | | Text | Text color | | TextFont | Text font | | TextSize | Text font size | ``` -------------------------------- ### Basic TextLabel Element Definition - Lua Source: https://depso.gitbook.io/regui/plugins/custom-elements Demonstrates the creation of a 'PurpleText' element, which is a TextLabel. It includes a base configuration 'IsBigText' and a 'Create' function that sets the TextSize based on this configuration. The function must return a GuiObject. ```lua ReGui:DefineElement("PurpleText", { --// Method name Base = { --// Configuration base IsBigText = true }, Create = function(self, Config) local IsBigText = Config.IsBigText -- true local Label = Instance.new("TextLabel") Label.TextSize = IsBigText and 30 or 14 --// Must return: Instance or Table, Instance return Label end, }) ``` -------------------------------- ### Utility Functions Source: https://depso.gitbook.io/regui/regui-functions Miscellaneous utility functions for data manipulation, input checking, and information retrieval. ```APIDOC ## ReGui:GetDictSize ### Description Returns the number of items in a dict. ### Method `ReGui:GetDictSize(Dict: table): number` ### Parameters * **Dict** (table) - Required - The dictionary (table) to get the size of. ### Returns * **number** - The number of items in the dictionary. ## ReGui:StackWindows ### Description Position Windows in a cascade. ### Method `ReGui:StackWindows()` ## ReGui:MergeMetatables ### Description Merge two metatables together. This also accounts for setting values (__newindex). ### Method `ReGui:MergeMetatables(First, Second)` ### Parameters * **First** - Required - The first metatable. * **Second** - Required - The second metatable. ## ReGui:GetElementFlags ### Description Returns the flags connected with the Object. Internally, Object is the raw element object. ### Method `ReGui:GetElementFlags(Object: GuiObject): table?` ### Parameters * **Object** (GuiObject) - Required - The GUI object to get flags from. ### Returns * **table?** - A table of flags associated with the object, or nil. ## ReGui:IsMouseEvent ### Description Checks if the passed InputObject is a mouse event. ### Method `ReGui:IsMouseEvent(Input: InputObject, IgnoreMovement: boolean): boolean` ### Parameters * **Input** (InputObject) - Required - The input object to check. * **IgnoreMovement** (boolean) - Required - Whether to ignore movement events. ### Returns * **boolean** - True if the input is a mouse event, false otherwise. ## ReGui:SetItemTooltip ### Description Set the tooltip for an object. Render will be called with the tooltip canvas. ### Method `ReGui:SetItemTooltip(Parent: GuiObject, Render: (Elements) -> ...any)` ### Parameters * **Parent** (GuiObject) - Required - The parent GUI object for the tooltip. * **Render** (function) - Required - A function that renders the tooltip content. ## ReGui:GetMouseLocation ### Description Returns an X and Y number for the location of the mouse. ### Method `ReGui:GetMouseLocation(): (number, number)` ### Returns * **(number, number)** - The X and Y coordinates of the mouse cursor. ## ReGui:GetThemeKey ### Description Looks up the theme and retrieves the key value. ### Method `ReGui:GetThemeKey(Theme: (string|table), Key: string): any` ### Parameters * **Theme** (string|table) - Required - The theme identifier or table. * **Key** (string) - Required - The key to look up within the theme. ### Returns * **any** - The value associated with the key in the theme. ## ReGui:CheckConfig ### Description Compares the values in Source to the values in Base and adds the missing keys/values from Base if they are nil or missing. If Call is true, Base values should be functions used when Source is missing the key or value as they will be called to return the value. ### Method `ReGui:CheckConfig(Source: table, Base: table, Call: boolean?, IgnoreKeys: table?)` ### Parameters * **Source** (table) - Required - The configuration table to check. * **Base** (table) - Required - The base configuration table. * **Call** (boolean?) - Optional - If true, base values are functions that will be called. * **IgnoreKeys** (table?) - Optional - A table of keys to ignore during the comparison. ## ReGui:GetScreenSize ### Description Returns a Vector2 of the ViewportSize. ### Method `ReGui:GetScreenSize(): Vector2` ### Returns * **Vector2** - The screen's viewport size. ## ReGui:IsConsoleDevice ### Description Checks if there is a GamePad connected. ### Method `ReGui:IsConsoleDevice(): boolean` ### Returns * **boolean** - True if a console device is detected, false otherwise. ## ReGui:IsMobileDevice ### Description Checks if there is a touchscreen. ### Method `ReGui:IsMobileDevice(): boolean` ### Returns * **boolean** - True if a mobile device (touchscreen) is detected, false otherwise. ## ReGui:GetVersion ### Description Returns the ReGui version number string. ### Method `ReGui:GetVersion(): string` ### Returns * **string** - The version number of ReGui. ## ReGui:IsDoubleClick ### Description Checks if the range should be considered a double click. ### Method `ReGui:IsDoubleClick(TickRange: number): boolean` ### Parameters * **TickRange** (number) - Required - The time range in ticks to check for a double click. ### Returns * **boolean** - True if the action is considered a double click, false otherwise. ## ReGui:Warn ### Description Prints a concatenated warn message from passed arguments. ### Method `ReGui:Warn(...)` ### Parameters * **...** - Variable number of arguments to concatenate into a warning message. ## ReGui:Concat ### Description An improved table.concat function. ### Method `ReGui:Concat(Table, Separator: " "): string` ### Parameters * **Table** - Required - The table to concatenate. * **Separator** (string) - Optional - The separator to use between elements (defaults to space). ### Returns * **string** - The concatenated string. ``` -------------------------------- ### Define Custom Element with Configuration - Lua Source: https://depso.gitbook.io/regui/plugins/custom-elements Defines a custom element named 'ElementName' with base configuration, optional color data for theming, and optional theme tags. The 'Create' function is responsible for generating the GuiObject. This function receives the canvas class ('self') and a configuration object ('Config'). ```lua ReGui:DefineElement("ElementName", { -- These are the base values for the Config Base = { RichText = true, TextWrapped = true }, -- (OPTIONAL) This is the coloring infomation the theme system will use ColorData = { ["ColorStyle Name"] = { TextColor3 = "ErrorText", FontFace = "TextFont", }, }, -- (OPTIONAL) These values will be set in the base theme ThemeTags = { ["ThemeTag"] = Color3.fromRGB(255, 69, 69), ["CoolFont"] = Font.fromName("Ubuntu"), }, --[[ This is the generation function for the element self is the canvas class Config is the configuration with overwrites to the Base config ]]-- Create = function(self, Config: Label) -- This MUST either return: -- GuiObject -- Class, GuiObject end, }) ``` -------------------------------- ### InputCFrame Type Definition Source: https://depso.gitbook.io/regui/elements/inputcframe Defines the structure of the InputCFrame type, including its properties and callback functions. ```APIDOC ## InputCFrame Type Definition ### Description Defines the structure of the InputCFrame type, which is used for input elements that handle CFrame values. ### Type Definition ```typescript type InputCFrame = { Label: string?, Value: CFrame?, Minimum: CFrame?, Maximum: CFrame?, Callback: (InputCFrame, Value: CFrame) -> any, SetValue: (InputCFrame, Value: CFrame) -> InputCFrame } ``` ### Example Usage ```lua :InputCFrame({ Value = CFrame.new(1,1,1), Minimum = CFrame.new(0,0,0), Maximum = CFrame.new(200, 100, 50), --Callback = print }) ``` ### Theme Colors This section details the theme color tags that can be used to customize the appearance of the InputCFrame. #### Theme Colors Table | Tag | Affects | |---------------------|-------------------------| | FrameBg | Background color | | FrameBgTransparency | Background transparency | | Text | Text color | | TextFont | Text font | | TextSize | Text font size | ```