Class · inherits GuiBase
GuiBase2d
An abstract class inherited by 2D GuiObjects.
About GuiBase2d
GuiBase2d is an abstract class inherited by 2D
GuiObjects.
Properties 10
AbsolutePosition
: Vector2ReadOnlyNotReplicatedDescribes the actual screen position of aGuiBase2delement, in pixels.AbsolutePositionis a read-only property that provides the screen position of aGuiBase2delement in pixels. This represents the actual pixel position at which an element renders as a result of its ancestors' sizes and positions. Note thatAbsolutePositionalways represents the top-left corner of theGuiBase2delement.If the
GuiBase2dis in aScreenGui, theAbsolutePositionproperty uses theCoreUISafeInsetsviewport 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 theInputObject.Positionproperty.See also
AbsoluteRotationandAbsoluteSize.AbsoluteRotation
: floatReadOnlyNotReplicatedDescribes the actual screen rotation of aGuiBase2delement, in degrees.AbsoluteRotationis a read-only property that describes the actual screen rotation of aGuiBase2delement, in degrees. It does not perform bounds checking, so its value may not be in the range0to360.See also
AbsolutePositionandAbsoluteSize.AbsoluteSize
: Vector2ReadOnlyNotReplicatedDescribes the actual screen size of aGuiBase2delement, in pixels.AbsoluteSizeis a read-only property that describes the actual screen size of aGuiBase2delement, in pixels.See also
AbsolutePositionandAbsoluteRotation.AutoLocalize
: booleanWhen set totrue, localization will be applied to thisGuiBase2dand its descendants.When set to
true, localization will be applied to thisGuiBase2dand its descendants. The entries used for localization are the same set of entries returned byLocalizationService.GetTableEntries. Entries withAutoLocalizeenabled are automatically re-translated after the cloud table loads if necessary.See also
RootLocalizationTable.RootLocalizationTable
: LocalizationTableA reference to aLocalizationTableto be used to apply automated localization to thisGuiBase2dand its descendants.A reference to a
LocalizationTableto be used to apply automated localization to thisGuiBase2dand its descendants.AutoLocalizemust be set totrueon theGuiBase2dand its ancestors for automated localization to be applied.You can set this to reference a
LocalizationTableanywhere in theDataModel. TheGuiBase2dobject and all of its children will try to use that specificLocalizationTableand its ancestors for automatic text replacement before using the tables underLocalizationServicein 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.GetTableEntrieswhich explains how theRootLocalizationTableis used for automated localization.SelectionBehaviorDown
: SelectionBehaviorCustomizes gamepad selection behavior in the down direction.SelectionBehaviorDowncustomizes how gamepad selection moves in the down direction out of a selection group. It only has an effect whenSelectionGroupistrue;SelectionGroupisfalseby default, and while it remainsfalsethis property has no effect.Its default value is
SelectionBehavior.Escape, which prioritizes buttons within the selection group but allows the selection to move to aGuiObjectoutside the group in the down direction if no suitable button is found inside. Setting it toSelectionBehavior.Stopinstead constrains the selection to the group, preventing it from moving downward out of the group.See also
SelectionGroup.SelectionBehaviorLeft
: SelectionBehaviorCustomizes gamepad selection behavior in the left direction.SelectionBehaviorLeftcustomizes how gamepad selection moves in the left direction out of a selection group. It only has an effect whenSelectionGroupistrue;SelectionGroupisfalseby default, and while it remainsfalsethis property has no effect.Its default value is
SelectionBehavior.Escape, which prioritizes buttons within the selection group but allows the selection to move to aGuiObjectoutside the group in the left direction if no suitable button is found inside. Setting it toSelectionBehavior.Stopinstead constrains the selection to the group, preventing it from moving leftward out of the group.See also
SelectionGroup.SelectionBehaviorRight
: SelectionBehaviorCustomizes gamepad selection behavior in the right direction.SelectionBehaviorRightcustomizes how gamepad selection moves in the right direction out of a selection group. It only has an effect whenSelectionGroupistrue;SelectionGroupisfalseby default, and while it remainsfalsethis property has no effect.Its default value is
SelectionBehavior.Escape, which prioritizes buttons within the selection group but allows the selection to move to aGuiObjectoutside the group in the right direction if no suitable button is found inside. Setting it toSelectionBehavior.Stopinstead constrains the selection to the group, preventing it from moving rightward out of the group.See also
SelectionGroup.SelectionBehaviorUp
: SelectionBehaviorCustomizes gamepad selection behavior in the up direction.SelectionBehaviorUpcustomizes how gamepad selection moves in the up direction out of a selection group. It only has an effect whenSelectionGroupistrue;SelectionGroupisfalseby default, and while it remainsfalsethis property has no effect.Its default value is
SelectionBehavior.Escape, which prioritizes buttons within the selection group but allows the selection to move to aGuiObjectoutside the group in the up direction if no suitable button is found inside. Setting it toSelectionBehavior.Stopinstead constrains the selection to the group, preventing it from moving upward out of the group.See also
SelectionGroup.SelectionGroup
: booleanAllows customization of gamepad selection movement.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
SelectionGrouptotrueexposes theSelectionBehaviorUp,SelectionBehaviorDown,SelectionBehaviorLeft, andSelectionBehaviorRightproperties. For these selection behaviors, a setting ofSelectionBehavior.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 ofSelectionBehavior.Stopmeans gamepad selection only looks within the selection group and does not move outside of the group from the selection behavior direction.
Events 1
SelectionChanged
GuiBase2d.SelectionChanged:Connect(function(amISelected, previousSelection, newSelection))Fires when the gamepad selection moves to, leaves, or changes within the connectedGuiBase2dor any descendantGuiObjects.This event fires when the gamepad selection moves to, leaves, or changes within the connected
GuiBase2dor any descendantGuiObjects. When the selection highlight moves to aGuiObject, the event bubbles from thatGuiObjectto all of its ancestors, informing them that the selection has changed/entered/exited to aGuiObjectin their descendant tree.
GuiBase2d also has every member of GuiBase. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.