rojo/.cursor/rules/roblox/reference/engine/classes/GuiBase2d.yaml
2026-02-02 12:08:47 -06:00

356 lines
12 KiB
YAML

# This file is automatically generated. Please don't edit it manually.
# To submit a bug report on the content, see
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
name: GuiBase2d
type: class
memory_category: Instances
summary: |
An abstract class inherited by 2D `Class.GuiObject|GuiObjects`.
description: |
`Class.GuiBase2d` is an abstract class inherited by 2D
`Class.GuiObject|GuiObjects`.
code_samples: []
inherits:
- GuiBase
descendants:
- GuiObject
- LayerCollector
tags:
- NotCreatable
- NotBrowsable
deprecation_message: ''
properties:
- name: GuiBase2d.AbsolutePosition
summary: |
Describes the actual screen position of a `Class.GuiBase2d` element, in
pixels.
description: |
`Class.GuiBase2d.AbsolutePosition|AbsolutePosition` is a read-only
property that provides the screen position of a `Class.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
`Class.GuiBase2d.AbsolutePosition|AbsolutePosition` always represents the
top-left corner of the `Class.GuiBase2d` element.
If the `Class.GuiBase2d` is in a `Class.ScreenGui`, the
`Class.GuiBase2d.AbsolutePosition|AbsolutePosition` property uses the
`Enum.ScreenInsets|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 `Class.InputObject.Position` property.
<img src="/assets/engine-api/classes/GuiBase2d/AbsolutePositionCoordinateSystem.png" width="840" alt="Diagram showing the origin of the AbsolutePosition coordinate system." />
See also `Class.GuiBase2d.AbsoluteRotation|AbsoluteRotation` and
`Class.GuiBase2d.AbsoluteSize|AbsoluteSize`.
code_samples: []
type: Vector2
tags:
- ReadOnly
- NotReplicated
deprecation_message: ''
security:
read: None
write: None
thread_safety: Unsafe
category: Data
serialization:
can_load: false
can_save: false
capabilities:
- UI
- name: GuiBase2d.AbsoluteRotation
summary: |
Describes the actual screen rotation of a `Class.GuiBase2d` element, in
degrees.
description: |
`Class.GuiBase2d.AbsoluteRotation|AbsoluteRotation` is a read-only
property that describes the actual screen rotation of a `Class.GuiBase2d`
element, in degrees. It does **not** perform bounds checking, so its value
may not be in the range `0` to `360`.
See also `Class.GuiBase2d.AbsolutePosition|AbsolutePosition` and
`Class.GuiBase2d.AbsoluteSize|AbsoluteSize`.
code_samples: []
type: float
tags:
- ReadOnly
- NotReplicated
deprecation_message: ''
security:
read: None
write: None
thread_safety: Unsafe
category: Data
serialization:
can_load: false
can_save: false
capabilities:
- UI
- name: GuiBase2d.AbsoluteSize
summary: |
Describes the actual screen size of a `Class.GuiBase2d` element, in
pixels.
description: |
`Class.GuiBase2d.AbsoluteSize|AbsoluteSize` is a read-only property that
describes the actual screen size of a `Class.GuiBase2d` element, in
pixels.
See also `Class.GuiBase2d.AbsolutePosition|AbsolutePosition` and
`Class.GuiBase2d.AbsoluteRotation|AbsoluteRotation`.
code_samples: []
type: Vector2
tags:
- ReadOnly
- NotReplicated
deprecation_message: ''
security:
read: None
write: None
thread_safety: Unsafe
category: Data
serialization:
can_load: false
can_save: false
capabilities:
- UI
- name: GuiBase2d.AutoLocalize
summary: |
When set to `true`, localization will be applied to this `Class.GuiBase2d`
and its descendants.
description: |
When set to `true`, localization will be applied to this `Class.GuiBase2d`
and its descendants. The entries used for localization are the same set of
entries returned by `Class.LocalizationService:GetTableEntries()`. Entries
with `Class.GuiBase2d.AutoLocalize|AutoLocalize` enabled are automatically
re-translated after the cloud table loads if necessary.
See also `Class.GuiBase2d.RootLocalizationTable|RootLocalizationTable`.
code_samples: []
type: boolean
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Localization
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: GuiBase2d.Localize
summary: |
Automatically set to true when a localization table's
`Class.LocalizationTable.Root` targets this object, or an ancestor of this
object.
description: |
This property is automatically set to true when a localization table's
`Class.LocalizationTable.Root` targets this object, or an ancestor of this
object. `Class.LocalizationTable|LocalizationTables` with their
`Class.LocalizationTable.Root` property pointed at an instance will
localize all `Class.TextLabel.TextButton` that are descendants of the root
instance.
code_samples: []
type: boolean
tags:
- Hidden
- NotReplicated
- Deprecated
deprecation_message: |
This item is deprecated. Do not use it for new work.
security:
read: None
write: None
thread_safety: ReadSafe
category: Localization
serialization:
can_load: true
can_save: false
capabilities:
- UI
- name: GuiBase2d.RootLocalizationTable
summary: |
A reference to a `Class.LocalizationTable` to be used to apply automated
localization to this `Class.GuiBase2d` and its descendants.
description: |
A reference to a `Class.LocalizationTable` to be used to apply automated
localization to this `Class.GuiBase2d` and its descendants.
`Class.GuiBase2d.AutoLocalize|AutoLocalize` must be set to `true` on the
`Class.GuiBase2d` and its ancestors for automated localization to be
applied.
You can set this to reference a `Class.LocalizationTable` anywhere in the
`Class.DataModel`. The `Class.GuiBase2d` object and all of its children
will try to use that specific `Class.LocalizationTable` and its ancestors
for automatic text replacement before using the tables under
`Class.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
`Class.LocalizationTable`, and so on.
See also `Class.LocalizationService:GetTableEntries()` which explains how
the `Class.GuiBase2d.RootLocalizationTable|RootLocalizationTable` is used
for automated localization.
code_samples: []
type: LocalizationTable
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Localization
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: GuiBase2d.SelectionBehaviorDown
summary: |
Customizes gamepad selection behavior in the down direction.
description: |
Customizes gamepad selection behavior in the down direction.
code_samples: []
type: SelectionBehavior
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Selection
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: GuiBase2d.SelectionBehaviorLeft
summary: |
Customizes gamepad selection behavior in the left direction.
description: |
Customizes gamepad selection behavior in the left direction.
code_samples: []
type: SelectionBehavior
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Selection
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: GuiBase2d.SelectionBehaviorRight
summary: |
Customizes gamepad selection behavior in the right direction.
description: |
Customizes gamepad selection behavior in the right direction.
code_samples: []
type: SelectionBehavior
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Selection
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: GuiBase2d.SelectionBehaviorUp
summary: |
Customizes gamepad selection behavior in the up direction.
description: |
Customizes gamepad selection behavior in the up direction.
code_samples: []
type: SelectionBehavior
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Selection
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: GuiBase2d.SelectionGroup
summary: |
Allows customization of gamepad selection movement.
description: |
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 `Class.GuiBase2d.SelectionGroup|SelectionGroup` to `true` exposes
the `Class.GuiBase2d.SelectionBehaviorUp|SelectionBehaviorUp`,
`Class.GuiBase2d.SelectionBehaviorDown|SelectionBehaviorDown`,
`Class.GuiBase2d.SelectionBehaviorLeft|SelectionBehaviorLeft`, and
`Class.GuiBase2d.SelectionBehaviorRight|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.
code_samples: []
type: boolean
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Selection
serialization:
can_load: true
can_save: true
capabilities:
- UI
methods: []
events:
- name: GuiBase2d.SelectionChanged
summary: |
Fires when the gamepad selection moves to, leaves, or changes within the
connected `Class.GuiBase2d` or any descendant
`Class.GuiObject|GuiObjects`.
description: |
This event fires when the gamepad selection moves to, leaves, or changes
within the connected `Class.GuiBase2d` or any descendant
`Class.GuiObject|GuiObjects`. When the selection highlight moves to a
`Class.GuiObject`, the event bubbles from that `Class.GuiObject` to all of
its ancestors, informing them that the selection has
changed/entered/exited to a `Class.GuiObject` in their descendant tree.
code_samples: []
parameters:
- name: amISelected
type: boolean
default:
summary: |
True if the new selection matches the attached GuiBase2d.
- name: previousSelection
type: GuiObject
default:
summary: ''
- name: newSelection
type: GuiObject
default:
summary: ''
tags: []
deprecation_message: ''
security: None
capabilities:
- UI
callbacks: []