Skip to content

UI ​

Types ​

Dict type ​

luau
type Dict<T> = { [T]: any }

Symbol type ​

luau
type Symbol = { type: "Symbol" }

Platform type ​

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

ActiveStateType type ​

luau
type ActiveStateType = "hover" | "floating" | "dialog"

TextRequest type ​

luau
type TextRequest = { Text: string, Font: Font, Size: number, RichText: boolean? }

Properties ​

Class ​

luau
UI.Class: {}

Sound ​

luau
UI.Sound: {}

GuiService ​

luau
UI.GuiService: GuiService

TextService ​

luau
UI.TextService: TextService

UserInputService ​

luau
UI.UserInputService: UserInputService

LocalPlayer ​

luau
UI.LocalPlayer

PlayerGui ​

luau
UI.PlayerGui

Touch ​

luau
UI.Touch

IsConsoleScreen ​

luau
UI.IsConsoleScreen: boolean

Platform ​

luau
UI.Platform: Platform

Hook ​

luau
UI.Hook: Symbol

A marker for defining UI state hooks in UI.edit

Function ​

luau
UI.Function: Symbol

A marker for defining function defaultState in UI.makeStatefulDefaults

Nil ​

luau
UI.Nil: Symbol

A marker for defining Nil defaultState in UI.makeStatefulDefaults

TopbarInset ​

luau
UI.TopbarInset

GuiService.TopbarInset as a Flux state

TopbarPadding ​

luau
UI.TopbarPadding: any

LayerBottom ​

luau
UI.LayerBottom

The lowermost ScreenGui for UI components

LayerDefault ​

luau
UI.LayerDefault

The default ScreenGui for UI components

LayerTop ​

luau
UI.LayerTop

The topmost ScreenGui for UI components

LayerTopInset ​

luau
UI.LayerTopInset

LayerTopbar ​

luau
UI.LayerTopbar

The Topbar ScreenGui for UI components

TopbarFrame ​

luau
UI.TopbarFrame

A sorted Topbar Frame for UI components, parented under UI.LayerTopbar

Fonts Module ​

luau
UI.Fonts: Fonts

Theme Module ​

luau
UI.Theme: Theme

Themes from Theme ​

luau
UI.Themes: {}

Functions ​

getFontName ​

luau
UI.getFontName(font: Font | Enum.Font)

activateState ​

luau
UI.activateState(activeState: any, stateType: ActiveStateType)

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

deactivateState ​

luau
UI.deactivateState(activeState: any, stateType: ActiveStateType)

A generalized function to deactivate both floating and hover states

toggleState ​

luau
UI.toggleState(activeState: any, stateType: ActiveStateType)

A generalized function to toggle both floating and hover states

clearState ​

luau
UI.clearState(stateType: ActiveStateType)

Function to clear a specific state type

clearActiveStates ​

luau
UI.clearActiveStates()

Function to clear all active state types

invertLuminance ​

luau
UI.invertLuminance(color: Color3, amount: number): Color3

Inverts the luminance of a Color3 by an amount

retryGetTextBoundsAsync Yields ​

luau
UI.retryGetTextBoundsAsync(params)

textWidth ​

luau
UI.textWidth(getRequests: () -> { TextRequest }): (Flux.Node<number>, Flux.Node<any>)

Measures the widest of getRequests() without yielding inside the reactive graph. getRequests runs in an effect (its reads are tracked); the returned signal starts at an estimate and settles to the measured width once TextService:GetTextBoundsAsync resolves on a deferred thread. Stale measurements are dropped. Never call UI.retryGetTextBoundsAsync inside a computed, effect, or reactive property: it yields mid-flush, which stalls Flux and corrupts dependency tracking for every other thread. Returns the width signal and the measuring effect; dispose both with the owning component.

makeStatefulDefaults ​

luau
UI.makeStatefulDefaults(default: Dict<any>, definition: Dict<any>?)

Helper function for defining Flux state defaults

newSinkHoverState ​

luau
UI.newSinkHoverState(object: GuiObject, hovering: any?, options: Flux.HoverOptions?)

edit ​

luau
UI.edit(new: Instance | Dict<any>)

Inherits Flux.edit

  • Parents children to the ._content variable of a UI component if one exists
  • Unwraps UI component children and auto-numbers [GuiObject.LayoutOrder] sequentially via Flux.edit
  • Allows UI.Hook to easily hook to default UI state or RBXScriptSignal aliases

new ​

luau
UI.new(className: string)

Creates a new Instance with UI.edit

register ​

luau
UI.register(className: string, class: Dict<any>)

Registers a new UI component class

registerClasses ​

luau
UI.registerClasses(): typeof(UI)

Run to register the default classes for the UI module

getLuminance from Motion ​

luau
UI.getLuminance(c: Color3): number

Gets the luminance of a Color3

pointInGuiObject from Interact ​

luau
UI.pointInGuiObject(x: number, y: number, object: GuiObject): boolean

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

sinkInput from Interact ​

luau
UI.sinkInput(x: number, y: number, object: GuiObject, token: any?): boolean

Whether input at (x, y) would be claimed by an Active or input-sinking gui rendered above object, e.g. dropping a hover state while a floating menu covers the control. Outside a BasePlayerGui (a plugin dock, a SurfaceGui in workspace) nothing can claim the point, so this yields false. With token (the InputObject), the hit test is asked once per input per point, however many objects under the pointer ask.

Open Documentation

Haptic ​

Click ​

luau
UI.Haptic.Click

Hover ​

luau
UI.Haptic.Hover

Notification ​

luau
UI.Haptic.Notification