GuiBase2d

Show Deprecated
Not Creatable
Not Browsable

GuiBase2d is an abstract class inherited by 2D GuiObjects.

Summary

Properties

Events

Properties

AbsolutePosition

Read Only
Not Replicated

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 the object's AnchorPoint influences AbsolutePosition.

See also AbsoluteRotation and AbsoluteSize.

AbsoluteRotation

Read Only
Not Replicated

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

Read Only
Not Replicated

AbsoluteSize is a read-only property that describes the actual screen size of a GuiBase2d element, in pixels.

See also AbsolutePosition and AbsoluteRotation.

AutoLocalize

Read Parallel

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.

RootLocalizationTable

Read Parallel

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

Read Parallel

Customizes gamepad selection behavior in the down direction.

SelectionBehaviorLeft

Read Parallel

Customizes gamepad selection behavior in the left direction.

SelectionBehaviorRight

Read Parallel

Customizes gamepad selection behavior in the right direction.

SelectionBehaviorUp

Read Parallel

Customizes gamepad selection behavior in the up direction.

SelectionGroup

Read Parallel

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 Enum.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 Enum.SelectionBehavior.Stop means gamepad selection only looks within the selection group and does not move outside of the group from the selection behavior direction.

Methods

Events

SelectionChanged

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.

Parameters

amISelected: bool

True if the new selection matches the attached GuiBase2d.

previousSelection: GuiObject
newSelection: GuiObject