Home › Overview › MainModule
UI
Types
Dict type
type Dict<T> = { [T]: any }Symbol type
type Symbol = { type: "Symbol" }Platform type
type Platform = "Console" | "Mobile" | "PC" | "VR"ActiveStateType type
type ActiveStateType = "hover" | "floating" | "dialog"TextRequest type
type TextRequest = { Text: string, Font: Font, Size: number, RichText: boolean? }Properties
Class
UI.Class: {}Sound
UI.Sound: {}GuiService
UI.GuiService: GuiServiceTextService
UI.TextService: TextServiceUserInputService
UI.UserInputService: UserInputServiceLocalPlayer
UI.LocalPlayerPlayerGui
UI.PlayerGuiTouch
UI.TouchIsConsoleScreen
UI.IsConsoleScreen: booleanPlatform
UI.Platform: PlatformHook
UI.Hook: SymbolA marker for defining UI state hooks in UI.edit
Function
UI.Function: SymbolA marker for defining function defaultState in UI.makeStatefulDefaults
Nil
UI.Nil: SymbolA marker for defining Nil defaultState in UI.makeStatefulDefaults
TopbarInset
UI.TopbarInsetGuiService.TopbarInset as a Flux state
TopbarPadding
UI.TopbarPadding: anyLayerBottom
UI.LayerBottomThe lowermost ScreenGui for UI components
LayerDefault
UI.LayerDefaultThe default ScreenGui for UI components
LayerTop
UI.LayerTopThe topmost ScreenGui for UI components
LayerTopInset
UI.LayerTopInsetLayerTopbar
UI.LayerTopbarThe Topbar ScreenGui for UI components
TopbarFrame
UI.TopbarFrameA sorted Topbar Frame for UI components, parented under UI.LayerTopbar
Fonts Module
UI.Fonts: FontsTheme Module
UI.Theme: ThemeThemes from Theme
UI.Themes: {}Functions
getFontName
activateState
UI.activateState(activeState: any, stateType: ActiveStateType)A generalized function to handle activation/deactivation of both floating and hover states
deactivateState
UI.deactivateState(activeState: any, stateType: ActiveStateType)A generalized function to deactivate both floating and hover states
toggleState
UI.toggleState(activeState: any, stateType: ActiveStateType)A generalized function to toggle both floating and hover states
clearState
UI.clearState(stateType: ActiveStateType)Function to clear a specific state type
clearActiveStates
UI.clearActiveStates()Function to clear all active state types
invertLuminance
Inverts the luminance of a Color3 by an amount
retryGetTextBoundsAsync Yields
UI.retryGetTextBoundsAsync(params)textWidth
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
Helper function for defining Flux state defaults
newSinkHoverState
UI.newSinkHoverState(object: GuiObject, hovering: any?, options: Flux.HoverOptions?)edit
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
RBXScriptSignalaliases
new
UI.new(className: string)Creates a new Instance with UI.edit
register
UI.register(className: string, class: Dict<any>)Registers a new UI component class
registerClasses
UI.registerClasses(): typeof(UI)Run to register the default classes for the UI module
getLuminance from Motion
UI.getLuminance(c: Color3): numberGets the luminance of a Color3
pointInGuiObject from Interact
UI.pointInGuiObject(x: number, y: number, object: GuiObject): booleanChecks if x, y is within the absolute bounds of the GuiObject
sinkInput from Interact
UI.sinkInput(x: number, y: number, object: GuiObject, token: any?): booleanWhether 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.
Haptic
Click
UI.Haptic.ClickHover
UI.Haptic.HoverNotification
UI.Haptic.Notification