GuiService¶
Offers numerous properties and methods for working with GuiObjects, player preferences, and other UI‑related tasks.
Description¶
GuiService offers numerous properties and methods for working with
GuiObjects, player preferences, and other UI‑related tasks.
Inheritance¶
Object → Instance → GuiService
Nova inheritance: Instance → GuiService
Properties¶
AutoSelectGuiEnabled Supported Property If activated, the Select button on a gamepad or Backslash will automatically set a GUI as the selected object.
If activated, the Select button on a gamepad or Backslash will automatically set a GUI as the selected object. Disabling this means that GUI navigation will still work if GuiNavigationEnabled is enabled, but you will have to set SelectedObject manually to start navigation.
IsModalDialog Supported Property Deprecated Indicates whether a modal dialog is visible.
Indicates whether a modal dialog is visible.
This property tells whether or not a modal dialog is visible, such as the game menu or a purchase prompt.
IsWindows Supported Property Deprecated Indicates whether the user is playing on a computer running Windows.
Indicates whether the user is playing on a computer running Windows.
The IsWindows property defines if the user is playing on a computer running Windows.
SelectedCoreObject Supported Property
No description available.
RobloxScriptSecuritySelectedObject Supported Property Sets the GuiObject currently being focused on by the GUI navigator.
Sets the GuiObject currently being focused on by the GUI
navigator. This may reset to nil if the object is off screen.
This property is changed by the SelectionGained and SelectionLost events. If you would like to determine when this property changes without tracking these events for all GUI elements, you can use the Changed event.
Methods¶
AddCenterDialog Supported Function
AddKey Supported Function
No description available.
RobloxScriptSecurityAddSelectionParent Supported Function Deprecated Creates a selection group where gamepad GUI navigation will only consider selectable objects that are within the group.
Creates a selection group where gamepad GUI navigation will only consider
selectable objects that are within the group (children of
selectionParent). An example is when you have a menu pop open and there
are other selectable objects on the screen, possibly from previous menus,
but you want the user to only be able to select GUI objects in the new
menu.
Roblox reference signature
AddSelectionTuple Supported Function Deprecated AddSelectionTuple works similarly to GuiService.AddSelectionParent(), but you can give it a tuple of GuiObject that you want to be contained in the g…
**AddSelectionTuple works similarly to GuiService.AddSelectionParent(), but you can give it a tuple of GuiObject that you want to be contained in the group.
Beware that the second argument is not a table, but rather the first of
several GuiObject in the tuple. To pass the contents of a table,
use unpack/table.unpack:
local frame = script.Parent
-- Passing various GuiObject individually
GuiService:AddSelectionTuple("InventoryButtons", frame.Sort, frame.Trash, frame.Drop)
-- Unpacking a table of GuiObject (unpack/table.unpack are equivalent)
local inventoryButtons = { frame.Sort, frame.Trash, frame.Drop }
GuiService:AddSelectionTuple("InventoryButtons", unpack(inventoryButtons))
```**
Functions similarly to [GuiService.AddSelectionParent](GuiService.md#addselectionparent)(), but you
can give it a tuple of [GuiObject](GuiObject.md) that you want to be contained in
the group.
<details>
<summary>Roblox reference signature</summary>
```lua
GuiService:AddSelectionTuple(selectionName: string, selections: Tuple): null