Class
GuiBase2d
NotCreatableNotBrowsable
An abstract class inherited by 2D GuiObjects.
GuiBase2d is an abstract class inherited by 2D
GuiObjects.
Properties 11#
AbsolutePositionVector2 | Describes the actual screen position of a GuiBase2d element, in
pixels.ReadOnlyNotReplicated |
AbsoluteRotationfloat | Describes the actual screen rotation of a GuiBase2d element, in
degrees.ReadOnlyNotReplicated |
AbsoluteSizeVector2 | Describes the actual screen size of a GuiBase2d element, in
pixels.ReadOnlyNotReplicated |
AutoLocalizeboolean | When set to true, localization will be applied to this GuiBase2d
and its descendants.ReadSafe |
Localizeboolean | Automatically set to true when a localization table's
LocalizationTable.Root targets this object, or an ancestor of this
object.ReadSafeDeprecatedHiddenNotReplicated |
RootLocalizationTableLocalizationTable | A reference to a LocalizationTable to be used to apply automated
localization to this GuiBase2d and its descendants.ReadSafe |
SelectionBehaviorDownSelectionBehavior | Customizes gamepad selection behavior in the down direction.ReadSafe |
SelectionBehaviorLeftSelectionBehavior | Customizes gamepad selection behavior in the left direction.ReadSafe |
SelectionBehaviorRightSelectionBehavior | Customizes gamepad selection behavior in the right direction.ReadSafe |
SelectionBehaviorUpSelectionBehavior | Customizes gamepad selection behavior in the up direction.ReadSafe |
SelectionGroupboolean | Allows customization of gamepad selection movement.ReadSafe |
AbsolutePosition: Vector2#
ReadOnlyNotReplicated
AbsolutePosition is a read-only
property that provides the screen position of a GuiBase2d element
in pixels. This represents the actual pixel position at which an element
renders as a result of its ancestors' sizes and positions. Note that
AbsolutePosition always represents the
top-left corner of the GuiBase2d element.
If the GuiBase2d is in a ScreenGui, the
AbsolutePosition property uses the
CoreUISafeInsets viewport coordinate system. The
origin of this coordinate system is located at the bottom-left corner of
the Roblox top bar. Note that this is the same coordinate system used by
the InputObject.Position property.

See also AbsoluteRotation and
AbsoluteSize.
AbsoluteRotation: float#
ReadOnlyNotReplicated
AbsoluteRotation is a read-only
property that describes the actual screen rotation of a GuiBase2d
element, in degrees. It does not perform bounds checking, so its value
may not be in the range 0 to 360.
See also AbsolutePosition and
AbsoluteSize.
AbsoluteSize: Vector2#
ReadOnlyNotReplicated
AbsoluteSize is a read-only property that
describes the actual screen size of a GuiBase2d element, in
pixels.
See also AbsolutePosition and
AbsoluteRotation.
AutoLocalize: boolean#
ReadSafe
When set to true, localization will be applied to this GuiBase2d
and its descendants. The entries used for localization are the same set of
entries returned by LocalizationService:GetTableEntries(). Entries
with AutoLocalize enabled are automatically
re-translated after the cloud table loads if necessary.
See also RootLocalizationTable.
Localize: boolean#
HiddenNotReplicatedDeprecatedReadSafeDeprecated
Deprecated. This item is deprecated. Do not use it for new work.
This property is automatically set to true when a localization table's
LocalizationTable.Root targets this object, or an ancestor of this
object. LocalizationTables with their
LocalizationTable.Root property pointed at an instance will
localize all TextLabel.TextButton that are descendants of the root
instance.
RootLocalizationTable: LocalizationTable#
ReadSafe
A reference to a LocalizationTable to be used to apply automated
localization to this GuiBase2d and its descendants.
AutoLocalize must be set to true on the
GuiBase2d and its ancestors for automated localization to be
applied.
You can set this to reference a LocalizationTable anywhere in the
DataModel. The GuiBase2d object and all of its children
will try to use that specific LocalizationTable and its ancestors
for automatic text replacement before using the tables under
LocalizationService in an undefined order and the cloud table.
If there is no translation available in the referenced table, it will look
for a translation in the parent of that table, if it is also a
LocalizationTable, and so on.
See also LocalizationService:GetTableEntries() which explains how
the RootLocalizationTable is used
for automated localization.
SelectionBehaviorDown: SelectionBehavior#
ReadSafe
SelectionBehaviorDown customizes
how gamepad selection moves in the down direction out of a selection
group. It only has an effect when
SelectionGroup is true;
SelectionGroup is false by default, and while it remains false this
property has no effect.
Its default value is SelectionBehavior.Escape, which prioritizes
buttons within the selection group but allows the selection to move to a
GuiObject outside the group in the down direction if no suitable
button is found inside. Setting it to SelectionBehavior.Stop
instead constrains the selection to the group, preventing it from moving
downward out of the group.
See also SelectionGroup.
SelectionBehaviorLeft: SelectionBehavior#
ReadSafe
SelectionBehaviorLeft customizes
how gamepad selection moves in the left direction out of a selection
group. It only has an effect when
SelectionGroup is true;
SelectionGroup is false by default, and while it remains false this
property has no effect.
Its default value is SelectionBehavior.Escape, which prioritizes
buttons within the selection group but allows the selection to move to a
GuiObject outside the group in the left direction if no suitable
button is found inside. Setting it to SelectionBehavior.Stop
instead constrains the selection to the group, preventing it from moving
leftward out of the group.
See also SelectionGroup.
SelectionBehaviorRight: SelectionBehavior#
ReadSafe
SelectionBehaviorRight customizes
how gamepad selection moves in the right direction out of a selection
group. It only has an effect when
SelectionGroup is true;
SelectionGroup is false by default, and while it remains false this
property has no effect.
Its default value is SelectionBehavior.Escape, which prioritizes
buttons within the selection group but allows the selection to move to a
GuiObject outside the group in the right direction if no suitable
button is found inside. Setting it to SelectionBehavior.Stop
instead constrains the selection to the group, preventing it from moving
rightward out of the group.
See also SelectionGroup.
SelectionBehaviorUp: SelectionBehavior#
ReadSafe
SelectionBehaviorUp customizes how
gamepad selection moves in the up direction out of a selection group. It
only has an effect when SelectionGroup is
true; SelectionGroup is false by default, and while it remains
false this property has no effect.
Its default value is SelectionBehavior.Escape, which prioritizes
buttons within the selection group but allows the selection to move to a
GuiObject outside the group in the up direction if no suitable
button is found inside. Setting it to SelectionBehavior.Stop
instead constrains the selection to the group, preventing it from moving
upward out of the group.
See also SelectionGroup.
SelectionGroup: boolean#
ReadSafe
Allows for customization of how gamepad selection can move between buttons, which are descendants of the selection group, leave the group, and select other buttons.
Setting SelectionGroup to true exposes
the SelectionBehaviorUp,
SelectionBehaviorDown,
SelectionBehaviorLeft, and
SelectionBehaviorRight
properties. For these selection behaviors, a setting of
SelectionBehavior.Escape (default) means the gamepad selection
tries to first find a selection within the selection group and only moves
outside if it does not find a suitable button. Alternatively, a setting of
SelectionBehavior.Stop means gamepad selection only looks within
the selection group and does not move outside of the group from the
selection behavior direction.
Events 1#
| SelectionChanged | Fires when the gamepad selection moves to, leaves, or changes within the
connected GuiBase2d or any descendant
GuiObjects. |
SelectionChanged(amISelected: boolean, previousSelection: GuiObject, newSelection: GuiObject)#
This event fires when the gamepad selection moves to, leaves, or changes
within the connected GuiBase2d or any descendant
GuiObjects. When the selection highlight moves to a
GuiObject, the event bubbles from that GuiObject to all of
its ancestors, informing them that the selection has
changed/entered/exited to a GuiObject in their descendant tree.
| Name | Type | Default | Description |
|---|---|---|---|
amISelected | boolean | True if the new selection matches the attached GuiBase2d. | |
previousSelection | GuiObject | The GuiObject that was previously selected before the
selection changed, or nil if nothing was selected. | |
newSelection | GuiObject | The GuiObject that is now selected after the selection
changed, or nil if nothing is selected. |
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild