Reference API Roblox

Engine API

Website

Related

Reference API Roblox

GuiBase2d

An abstract class inherited by 2D GuiObjects.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is not browsable. It is not visible in Studio's object browser.
Tags: [NotCreatable, NotBrowsable]

Member index 17

HistoryMember
553AbsolutePosition: Vector2
553AbsoluteRotation: float
553AbsoluteSize: Vector2
553AutoLocalize: bool
553RootLocalizationTable: LocalizationTable
553SelectionBehaviorDown: SelectionBehavior
553SelectionBehaviorLeft: SelectionBehavior
553SelectionBehaviorRight: SelectionBehavior
553SelectionBehaviorUp: SelectionBehavior
553SelectionGroup: bool
525SelectionChanged(amISelected: bool, previousSelection: GuiObject, newSelection: GuiObject)
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

GuiBase2d is an abstract class inherited by 2D GuiObjects.

History 89

Members 17

AbsolutePosition

TypeDefault
Vector2

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.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 3

Tags: [ReadOnly, NotReplicated]

AbsoluteRotation

TypeDefault
float

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.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 4

Tags: [ReadOnly, NotReplicated]

AbsoluteSize

TypeDefault
Vector2

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

See also AbsolutePosition and AbsoluteRotation.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 3

Tags: [ReadOnly, NotReplicated]

AutoLocalize

TypeDefault
bool

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.

History 5

RootLocalizationTable

TypeDefault
LocalizationTable

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.

History 7

SelectionBehaviorDown

TypeDefault
SelectionBehavior

Customizes gamepad selection behavior in the down direction.

History 8

SelectionBehaviorLeft

TypeDefault
SelectionBehavior

Customizes gamepad selection behavior in the left direction.

History 8

SelectionBehaviorRight

TypeDefault
SelectionBehavior

Customizes gamepad selection behavior in the right direction.

History 8

SelectionBehaviorUp

TypeDefault
SelectionBehavior

Customizes gamepad selection behavior in the up direction.

History 8

SelectionChanged

Parameters (3)
amISelectedbool
previousSelectionGuiObject
newSelectionGuiObject

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.

History 1

SelectionGroup

TypeDefault
bool

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.

History 8

Settings