Skip to main content

UI

Types

Platform

type Platform = "Console" | "Mobile" | "PC"

Theme

interface Theme {
ClackAllState<boolean>
ClackEnabledState<boolean>
TransparencyState<number>
PrimaryState<Color3>
PrimaryTextState<Color3>
SecondaryState<Color3>
SecondaryTextState<Color3>
MutedState<Color3>
MutedTextState<Color3>
BorderState<Color3>
BorderMutedState<Color3>
ValidState<Color3>
InvalidState<Color3>
FontSizeState<number>
FontState<Font>
FontMonoState<Font>
FontHeavyState<Font>
FontBoldState<Font>
FontSemiBoldState<Font>
FontLightState<Font>
CornerRadiusState<UDim>
CornerHalfState<UDim>
CornerDiameterState<UDim>
PaddingState<UDim>
PaddingHalfState<UDim>
PaddingDoubleState<UDim>
StrokeEnabledState<boolean>
NormalTweenState<TweenInfo>
TransparencyClampedState<number>
ScrollMidImageState<string>
ScrollTopImageState<string>
ScrollBottomImageState<string>
}

A directory of Flux state for UI components to use as theme variables

ActiveStateType

type ActiveStateType = "hover" | "floating"

Properties

GuiService

UI.GuiService: GuiService

TextService

UI.TextService: TextService

UserInputService

UI.UserInputService: UserInputService

LocalPlayer

UI.LocalPlayer: Player

PlayerGui

UI.PlayerGui: PlayerGui

Touch

UI.Touch: boolean

Platform

UI.Platform: Platform

Attribute

This item is read only and cannot be modified. Read Only
UI.Attribute: newproxy

A marker for defining Instance attributes in UI.edit

Children

This item is read only and cannot be modified. Read Only
UI.Children: newproxy

A marker for defining Instance children in UI.edit

Event

This item is read only and cannot be modified. Read Only
UI.Event: {
Attribute=newproxy,
Property=newproxy
}

Markers for defining events in UI.edit

Hook

This item is read only and cannot be modified. Read Only
UI.Hook: newproxy

A marker for defining UI state hooks in UI.edit

Nil

This item is read only and cannot be modified. Read Only
UI.Nil: newproxy

A marker for defining Nil defaultState in UI.makeStatefulDefaults

Scope

UI.Scope: Scope

A scope object for organizing and cleaning up UI states

TopbarInset

UI.TopbarInset: State<Rect>

GuiService.TopbarInset as a Flux state

LayerBottom

UI.LayerBottom: State<ScreenGui>

The lowermost ScreenGui for UI components

LayerDefault

UI.LayerDefault: State<ScreenGui>

The default ScreenGui for UI components

LayerTop

UI.LayerTop: State<ScreenGui>

The topmost ScreenGui for UI components

LayerTopBar

UI.LayerTopBar: State<ScreenGui>

The TopBar ScreenGui for UI components

TopBarFrame

UI.TopBarFrame: State<Frame>

A sorted TopBar Frame for UI components, parented under UI.LayerTopBar

Functions

activateState

UI.activateState(
activeStateState<boolean>,
stateTypeActiveStateType
) → ()

A generalized function to handle activation/deactivation of both floating and hover states

deactivateState

UI.deactivateState(
activeStateState<boolean>,
stateTypeActiveStateType
) → ()

A generalized function to deactivate both floating and hover states

toggleState

UI.toggleState(
activeStateState<boolean>,
stateTypeActiveStateType
) → ()

A generalized function to toggle both floating and hover states

clearState

UI.clearState(stateTypeActiveStateType) → ()

Function to clear a specific state type

getLuminance

UI.getLuminance(colorColor3) → number

Gets the luminance of a Color3

invertLuminance

UI.invertLuminance(
colorColor3,
amountnumber
) → Color3

Inverts the luminance of a Color3 by an amount

pointInGuiObject

UI.pointInGuiObject(
xnumber,
ynumber,
objectGuiObject
) → ()

Checks if x, y is within the absolute bounds of the GuiObject

makeStatefulDefaults

UI.makeStatefulDefaults(
defaultDict<any>,
definitionSpecialDefinition?
) → ()

Helper function for defining Flux state defaults

edit

UI.edit(
newInstance | Dict<any>,
definitionSpecialDefinition | GuiObject
) → Instance | Dict<any>

Inherits Flux.edit

  • Parents children to the ._content variable of a UI component if one exists
  • Numeric indicies are defined as children with GuiObject.LayoutOrder set to the index
  • Allows UI.Hook to easily hook to default UI state or RBXScriptSignal aliases

new

UI.new(classNamestring) → UI.edit

Creates a new Instance with UI.edit

register

UI.register(
classNamestring,
classDict<any>
) → ()

Registers a new UI component class

registerChildren

UI.registerChildren() → typeof(UI)

Run to register all default children in the UI module

Show raw api
{
    "functions": [
        {
            "name": "activateState",
            "desc": "A generalized function to handle activation/deactivation of both floating and hover states",
            "params": [
                {
                    "name": "activeState",
                    "desc": "",
                    "lua_type": "State<boolean>"
                },
                {
                    "name": "stateType",
                    "desc": "",
                    "lua_type": "ActiveStateType"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 397,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "deactivateState",
            "desc": "A generalized function to deactivate both floating and hover states",
            "params": [
                {
                    "name": "activeState",
                    "desc": "",
                    "lua_type": "State<boolean>"
                },
                {
                    "name": "stateType",
                    "desc": "",
                    "lua_type": "ActiveStateType"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 418,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "toggleState",
            "desc": "A generalized function to toggle both floating and hover states",
            "params": [
                {
                    "name": "activeState",
                    "desc": "",
                    "lua_type": "State<boolean>"
                },
                {
                    "name": "stateType",
                    "desc": "",
                    "lua_type": "ActiveStateType"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 436,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "clearState",
            "desc": "Function to clear a specific state type",
            "params": [
                {
                    "name": "stateType",
                    "desc": "",
                    "lua_type": "ActiveStateType"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 448,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "getLuminance",
            "desc": "Gets the luminance of a [Color3]",
            "params": [
                {
                    "name": "color",
                    "desc": "",
                    "lua_type": "Color3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 465,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "invertLuminance",
            "desc": "Inverts the luminance of a [Color3] by an amount",
            "params": [
                {
                    "name": "color",
                    "desc": "",
                    "lua_type": "Color3"
                },
                {
                    "name": "amount",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Color3\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 470,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "pointInGuiObject",
            "desc": "Checks if x, y is within the absolute bounds of the GuiObject",
            "params": [
                {
                    "name": "x",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "object",
                    "desc": "",
                    "lua_type": "GuiObject"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 489,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "makeStatefulDefaults",
            "desc": "Helper function for defining Flux state defaults",
            "params": [
                {
                    "name": "default",
                    "desc": "",
                    "lua_type": "Dict<any>"
                },
                {
                    "name": "definition",
                    "desc": "",
                    "lua_type": "SpecialDefinition?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 496,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "edit",
            "desc": "Inherits [Flux.edit]\n* Parents children to the ._content variable of a UI component if one exists\n* Numeric indicies are defined as children with [GuiObject.LayoutOrder] set to the index\n* Allows UI.Hook to easily hook to default UI state or [RBXScriptSignal] aliases",
            "params": [
                {
                    "name": "new",
                    "desc": "",
                    "lua_type": "Instance | Dict<any>"
                },
                {
                    "name": "definition",
                    "desc": "",
                    "lua_type": "SpecialDefinition | GuiObject"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Instance | Dict<any>\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 519,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "new",
            "desc": "Creates a new Instance with [UI.edit]",
            "params": [
                {
                    "name": "className",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "UI.edit"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 608,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "register",
            "desc": "Registers a new UI component class",
            "params": [
                {
                    "name": "className",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "class",
                    "desc": "",
                    "lua_type": "Dict<any>"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 616,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "registerChildren",
            "desc": "Run to register all default children in the UI module",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "typeof(UI)\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 624,
                "path": "MainModule/Client/UI/init.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "GuiService",
            "desc": "",
            "lua_type": "GuiService",
            "source": {
                "line": 51,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "TextService",
            "desc": "",
            "lua_type": "TextService",
            "source": {
                "line": 55,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "UserInputService",
            "desc": "",
            "lua_type": "UserInputService",
            "source": {
                "line": 59,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "LocalPlayer",
            "desc": "",
            "lua_type": "Player",
            "source": {
                "line": 63,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "PlayerGui",
            "desc": "",
            "lua_type": "PlayerGui",
            "source": {
                "line": 67,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Touch",
            "desc": "",
            "lua_type": "boolean",
            "source": {
                "line": 75,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Platform",
            "desc": "",
            "lua_type": "Platform",
            "source": {
                "line": 79,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Attribute",
            "desc": "A marker for defining Instance attributes in [UI.edit]",
            "lua_type": "newproxy",
            "readonly": true,
            "source": {
                "line": 88,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Children",
            "desc": "A marker for defining Instance children in [UI.edit]",
            "lua_type": "newproxy",
            "readonly": true,
            "source": {
                "line": 93,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Event",
            "desc": "Markers for defining events in [UI.edit]",
            "lua_type": "{ Attribute = newproxy, Property = newproxy }",
            "readonly": true,
            "source": {
                "line": 98,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Hook",
            "desc": "A marker for defining UI state hooks in [UI.edit]",
            "lua_type": "newproxy",
            "readonly": true,
            "source": {
                "line": 103,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Nil",
            "desc": "A marker for defining Nil defaultState in [UI.makeStatefulDefaults]",
            "lua_type": "newproxy",
            "readonly": true,
            "source": {
                "line": 109,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Scope",
            "desc": "A scope object for organizing and cleaning up UI states",
            "lua_type": "Scope",
            "source": {
                "line": 114,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "TopbarInset",
            "desc": "GuiService.TopbarInset as a Flux state",
            "lua_type": "State<Rect>",
            "source": {
                "line": 120,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "LayerBottom",
            "desc": "The lowermost ScreenGui for UI components",
            "lua_type": "State<ScreenGui>",
            "source": {
                "line": 128,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "LayerDefault",
            "desc": "The default ScreenGui for UI components",
            "lua_type": "State<ScreenGui>",
            "source": {
                "line": 140,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "LayerTop",
            "desc": "The topmost ScreenGui for UI components",
            "lua_type": "State<ScreenGui>",
            "source": {
                "line": 153,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "LayerTopBar",
            "desc": "The TopBar ScreenGui for UI components",
            "lua_type": "State<ScreenGui>",
            "source": {
                "line": 177,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "TopBarFrame",
            "desc": "A sorted TopBar Frame for UI components, parented under [UI.LayerTopBar]",
            "lua_type": "State<Frame>",
            "source": {
                "line": 190,
                "path": "MainModule/Client/UI/init.luau"
            }
        }
    ],
    "types": [
        {
            "name": "Platform",
            "desc": "",
            "lua_type": "\"Console\" | \"Mobile\" | \"PC\"",
            "source": {
                "line": 71,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "Theme",
            "desc": "A directory of Flux state for UI components to use as theme variables",
            "fields": [
                {
                    "name": "ClackAll",
                    "lua_type": "State<boolean>",
                    "desc": ""
                },
                {
                    "name": "ClackEnabled",
                    "lua_type": "State<boolean>",
                    "desc": ""
                },
                {
                    "name": "Transparency",
                    "lua_type": "State<number>",
                    "desc": ""
                },
                {
                    "name": "Primary",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "PrimaryText",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "Secondary",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "SecondaryText",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "Muted",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "MutedText",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "Border",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "BorderMuted",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "Valid",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "Invalid",
                    "lua_type": "State<Color3>",
                    "desc": ""
                },
                {
                    "name": "FontSize",
                    "lua_type": "State<number>",
                    "desc": ""
                },
                {
                    "name": "Font",
                    "lua_type": "State<Font>",
                    "desc": ""
                },
                {
                    "name": "FontMono",
                    "lua_type": "State<Font>",
                    "desc": ""
                },
                {
                    "name": "FontHeavy",
                    "lua_type": "State<Font>",
                    "desc": ""
                },
                {
                    "name": "FontBold",
                    "lua_type": "State<Font>",
                    "desc": ""
                },
                {
                    "name": "FontSemiBold",
                    "lua_type": "State<Font>",
                    "desc": ""
                },
                {
                    "name": "FontLight",
                    "lua_type": "State<Font>",
                    "desc": ""
                },
                {
                    "name": "CornerRadius",
                    "lua_type": "State<UDim>",
                    "desc": ""
                },
                {
                    "name": "CornerHalf",
                    "lua_type": "State<UDim>",
                    "desc": ""
                },
                {
                    "name": "CornerDiameter",
                    "lua_type": "State<UDim>",
                    "desc": ""
                },
                {
                    "name": "Padding",
                    "lua_type": "State<UDim>",
                    "desc": ""
                },
                {
                    "name": "PaddingHalf",
                    "lua_type": "State<UDim>",
                    "desc": ""
                },
                {
                    "name": "PaddingDouble",
                    "lua_type": "State<UDim>",
                    "desc": ""
                },
                {
                    "name": "StrokeEnabled",
                    "lua_type": "State<boolean>",
                    "desc": ""
                },
                {
                    "name": "NormalTween",
                    "lua_type": "State<TweenInfo>",
                    "desc": ""
                },
                {
                    "name": "TransparencyClamped",
                    "lua_type": "State<number>",
                    "desc": ""
                },
                {
                    "name": "ScrollMidImage",
                    "lua_type": "State<string>",
                    "desc": ""
                },
                {
                    "name": "ScrollTopImage",
                    "lua_type": "State<string>",
                    "desc": ""
                },
                {
                    "name": "ScrollBottomImage",
                    "lua_type": "State<string>",
                    "desc": ""
                }
            ],
            "source": {
                "line": 248,
                "path": "MainModule/Client/UI/init.luau"
            }
        },
        {
            "name": "ActiveStateType",
            "desc": "",
            "lua_type": "\"hover\" | \"floating\"",
            "source": {
                "line": 394,
                "path": "MainModule/Client/UI/init.luau"
            }
        }
    ],
    "name": "UI",
    "desc": "",
    "source": {
        "line": 45,
        "path": "MainModule/Client/UI/init.luau"
    }
}