API:Class/TextButton

Textbutton icon.pngTextButton : Object Icon.pngGuiButton : Object Icon.pngGuiObject : Object Icon.pngGuiBase2d : Object Icon.pngGuiBase : Object Icon.pngInstance

A TextButton is a GUI which can hold text, and can be interacted with by the player.

Properties

PropertiesmemberhiddenProperties [toggle]

FontFont

The font used to display the given text.

|RMD member="API:Class/TextButton/Font"|The font used to display the given text.|/RMD|
stringText

Sets the text that the TextButton displays.

|RMD member="API:Class/TextButton/Text"|Sets the text that the TextButton displays.|/RMD|
Vector2TextBounds [readonly]

The size of the TextButton's Text.

|RMD member="API:Class/TextButton/TextBounds"|The size of the TextButton's Text.|/RMD|
Color3TextColor3

Sets the color of the Text.

|RMD member="API:Class/TextButton/TextColor3"|Sets the color of the Text.|/RMD|
boolTextFits [readonly]

A boolean representation of whether the TextButton's text fits within the size of it.

|RMD member="API:Class/TextButton/TextFits"|A boolean representation of whether the TextButton's text fits within the size of it.|/RMD|
boolTextScaled

Changes whether text is resized to fit within the TextButton.

|RMD member="API:Class/TextButton/TextScaled"|Changes whether text is resized to fit within the TextButton.|/RMD|
floatTextSize

Sets the height of the text in pixels.

|RMD member="API:Class/TextButton/TextSize"|Sets the height of the text in pixels.|/RMD|
Color3TextStrokeColor3

Sets the color of the text stroke.

|RMD member="API:Class/TextButton/TextStrokeColor3"|Sets the color of the text stroke.|/RMD|
floatTextStrokeTransparency

Sets the transparency of the text stroke.

|RMD member="API:Class/TextButton/TextStrokeTransparency"|Sets the transparency of the text stroke.|/RMD|
floatTextTransparency

Sets the transparency of the text.

|RMD member="API:Class/TextButton/TextTransparency"|Sets the transparency of the text.|/RMD|
boolTextWrapped

Sets whether text should wrap to a new line at the edges of the TextButton.

|RMD member="API:Class/TextButton/TextWrapped"|Sets whether text should wrap to a new line at the edges of the TextButton.|/RMD|
TextXAlignmentTextXAlignment

Sets where text is placed on the X axis within the TextButton.

|RMD member="API:Class/TextButton/TextXAlignment"|Sets where text is placed on the X axis within the TextButton.|/RMD|
TextYAlignmentTextYAlignment

Sets where text is placed on the Y axis within the TextButton.

|RMD member="API:Class/TextButton/TextYAlignment"|Sets where text is placed on the Y axis within the TextButton.|/RMD|
FontSizeFontSize [deprecated]

Deprecated. Do not use.

|RMD member="API:Class/TextButton/FontSize"|Deprecated. Do not use.|/RMD|
stringLocalizedText [hidden] [readonly]

Sets whether a TextButton should be Localized or not.

|RMD member="API:Class/TextButton/LocalizedText"|Sets whether a TextButton should be Localized or not.|/RMD|
BrickColorTextColor [deprecated] [hidden]

Deprecated in favor of TextColor3.

|RMD member="API:Class/TextButton/TextColor"|Deprecated in favor of TextColor3.|/RMD|
boolTextWrap [deprecated]

Deprecated. Do not use.

|RMD member="API:Class/TextButton/TextWrap"|Deprecated. Do not use.|/RMD|
The font used to display the given text.
Sets the text that the TextButton displays.
TextBounds [readonly]
The size of the TextButton's Text.
Sets the color of the Text.
TextFits [readonly]
A boolean representation of whether the TextButton's text fits within the size of it.
Changes whether text is resized to fit within the TextButton.
Sets the height of the text in pixels.
Sets the color of the text stroke.
Sets the transparency of the text stroke.
Sets the transparency of the text.
Sets whether text should wrap to a new line at the edges of the TextButton.
Sets where text is placed on the X axis within the TextButton.
Sets where text is placed on the Y axis within the TextButton.
FontSize [deprecated]
Deprecated. Do not use.
LocalizedText [hidden] [readonly]
Sets whether a TextButton should be Localized or not.
TextColor [deprecated] [hidden]
Deprecated in favor of TextColor3.
TextWrap [deprecated]
Deprecated. Do not use.
Inherited from Object Icon.pngGuiButton:
boolAutoButtonColor

If true, the button will automatically change color when the mouse hovers over or clicks on it.

|RMD member="API:Class/GuiButton/AutoButtonColor"|If true, the button will automatically change color when the mouse hovers over or clicks on it.|/RMD|
boolModal

If true while the GUI element is visible, the mouse will not be locked unless the right mouse button is down.

|RMD member="API:Class/GuiButton/Modal"|If true while the GUI element is visible, the mouse will not be locked unless the right mouse button is down.|/RMD|
boolSelected

A boolean property which indicates whether the object has been selected.

|RMD member="API:Class/GuiButton/Selected"|A boolean property which indicates whether the object has been selected.|/RMD|
ButtonStyleStyle

Sets the style of the GuiButton based on a list of pre-determined styles.

|RMD member="API:Class/GuiButton/Style"|Sets the style of the GuiButton based on a list of pre-determined styles.|/RMD|
If true, the button will automatically change color when the mouse hovers over or clicks on it.
If true while the GUI element is visible, the mouse will not be locked unless the right mouse button is down.
A boolean property which indicates whether the object has been selected.
Sets the style of the GuiButton based on a list of pre-determined styles.
Inherited from Object Icon.pngGuiObject:
boolActive

Determines whether mouse events fall through to 3D space.

|RMD member="API:Class/GuiObject/Active"|Determines whether mouse events fall through to 3D space.|/RMD|
Vector2AnchorPoint

Sets the origin point of the GuiObject, relative to its absolute size.

|RMD member="API:Class/GuiObject/AnchorPoint"|Sets the origin point of the GuiObject, relative to its absolute size.|/RMD|
Color3BackgroundColor3

Determines the color of the background of a GUI element.

|RMD member="API:Class/GuiObject/BackgroundColor3"|Determines the color of the background of a GUI element.|/RMD|
floatBackgroundTransparency

Determines the transparency of the background of a GUI element.

|RMD member="API:Class/GuiObject/BackgroundTransparency"|Determines the transparency of the background of a GUI element.|/RMD|
Color3BorderColor3

Determines the color of a GUI element's border.

|RMD member="API:Class/GuiObject/BorderColor3"|Determines the color of a GUI element's border.|/RMD|
intBorderSizePixel

Determines the width of a GUI element's border in pixels.

|RMD member="API:Class/GuiObject/BorderSizePixel"|Determines the width of a GUI element's border in pixels.|/RMD|
boolClipsDescendants

Determines whether ROBLOX will render any portions of its GUI descendants that are outside of its own borders.

|RMD member="API:Class/GuiObject/ClipsDescendants"|Determines whether ROBLOX will render any portions of its GUI descendants that are outside of its own borders.|/RMD|
boolDraggable

Determines whether a GUI element (and its descendants) can be dragged around the screen.

|RMD member="API:Class/GuiObject/Draggable"|Determines whether a GUI element (and its descendants) can be dragged around the screen.|/RMD|
intLayoutOrder

Controls the sorting priority of this GuiObject.

|RMD member="API:Class/GuiObject/LayoutOrder"|Controls the sorting priority of this GuiObject.|/RMD|
Ref<GuiObject>NextSelectionDown

Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.

|RMD member="API:Class/GuiObject/NextSelectionDown"|Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.|/RMD|
Ref<GuiObject>NextSelectionLeft

Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.

|RMD member="API:Class/GuiObject/NextSelectionLeft"|Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.|/RMD|
Ref<GuiObject>NextSelectionRight

Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.

|RMD member="API:Class/GuiObject/NextSelectionRight"|Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.|/RMD|
Ref<GuiObject>NextSelectionUp

Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.

|RMD member="API:Class/GuiObject/NextSelectionUp"|Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.|/RMD|
UDim2Position

Determines the position of a GUI element.

|RMD member="API:Class/GuiObject/Position"|Determines the position of a GUI element.|/RMD|
floatRotation

Determines how many degrees a GUI element is rotated by. If non-zero, ClipsDescendants will not clip the GUI or any descendants.

|RMD member="API:Class/GuiObject/Rotation"|Determines how many degrees a GUI element is rotated by. If non-zero, ClipsDescendants will not clip the GUI or any descendants.|/RMD|
boolSelectable

Whether or not this object should be selectable using joysticks (controller).

|RMD member="API:Class/GuiObject/Selectable"|Whether or not this object should be selectable using joysticks (controller).|/RMD|
Ref<GuiObject>SelectionImageObject

Overrides the default selection adornment (used for gamepads). For best results, this should point to a GuiObject.

|RMD member="API:Class/GuiObject/SelectionImageObject"|Overrides the default selection adornment (used for gamepads). For best results, this should point to a GuiObject.|/RMD|
UDim2Size

Determines the size of a GUI element.

|RMD member="API:Class/GuiObject/Size"|Determines the size of a GUI element.|/RMD|
SizeConstraintSizeConstraint

Sets the direction that an object can be resized in.

|RMD member="API:Class/GuiObject/SizeConstraint"|Sets the direction that an object can be resized in.|/RMD|
boolSizeFromContents

If set to true, the gui object will be sized based on the contents parented to it.

|RMD member="API:Class/GuiObject/SizeFromContents"|If set to true, the gui object will be sized based on the contents parented to it.|/RMD|
boolVisible

Determines whether a GUI element and its descendants will be rendered or not.

|RMD member="API:Class/GuiObject/Visible"|Determines whether a GUI element and its descendants will be rendered or not.|/RMD|
intZIndex

Determines the order in which GUI objects are rendered, with 10 being in front and 1 in back.

|RMD member="API:Class/GuiObject/ZIndex"|Determines the order in which GUI objects are rendered, with 10 being in front and 1 in back.|/RMD|
BrickColorBackgroundColor [deprecated] [hidden]

Deprecated in favor of BackgroundColor3.

|RMD member="API:Class/GuiObject/BackgroundColor"|Deprecated in favor of BackgroundColor3.|/RMD|
BrickColorBorderColor [deprecated] [hidden]

Deprecated in favor of BorderColor3.

|RMD member="API:Class/GuiObject/BorderColor"|Deprecated in favor of BorderColor3.|/RMD|
floatTransparency [hidden]

A mixed property of BackgroundTransparency and TextTransparency.

|RMD member="API:Class/GuiObject/Transparency"|A mixed property of BackgroundTransparency and TextTransparency.|/RMD|
Determines whether mouse events fall through to 3D space.
Sets the origin point of the GuiObject, relative to its absolute size.
Determines the color of the background of a GUI element.
Determines the transparency of the background of a GUI element.
Determines the color of a GUI element's border.
Determines the width of a GUI element's border in pixels.
Determines whether ROBLOX will render any portions of its GUI descendants that are outside of its own borders.
Determines whether a GUI element (and its descendants) can be dragged around the screen.
Controls the sorting priority of this GuiObject.
Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.
Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.
Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.
Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction.
Determines the position of a GUI element.
Determines how many degrees a GUI element is rotated by. If non-zero, ClipsDescendants will not clip the GUI or any descendants.
Whether or not this object should be selectable using joysticks (controller).
Overrides the default selection adornment (used for gamepads). For best results, this should point to a GuiObject.
Determines the size of a GUI element.
Sets the direction that an object can be resized in.
If set to true, the gui object will be sized based on the contents parented to it.
Determines whether a GUI element and its descendants will be rendered or not.
Determines the order in which GUI objects are rendered, with 10 being in front and 1 in back.
BackgroundColor [deprecated] [hidden]
Deprecated in favor of BackgroundColor3.
BorderColor [deprecated] [hidden]
Deprecated in favor of BorderColor3.
Transparency [hidden]
A mixed property of BackgroundTransparency and TextTransparency.
Inherited from Object Icon.pngGuiBase2d:
Vector2AbsolutePosition [readonly]

The distance, in pixels, from the top left corner of the game window under the Topbar.

|RMD member="API:Class/GuiBase2d/AbsolutePosition"|The distance, in pixels, from the top left corner of the game window under the Topbar.|/RMD|
floatAbsoluteRotation [readonly]

The absolute rotation of this gui object.

|RMD member="API:Class/GuiBase2d/AbsoluteRotation"|The absolute rotation of this gui object.|/RMD|
Vector2AbsoluteSize [readonly]

Size of the GUI element in pixels.

|RMD member="API:Class/GuiBase2d/AbsoluteSize"|Size of the GUI element in pixels.|/RMD|
boolLocalize [hidden]

Automatically set to true when a LocalizationTable's Root targets this object, or an ancestor of this object.

|RMD member="API:Class/GuiBase2d/Localize"|Automatically set to true when a LocalizationTable's Root targets this object, or an ancestor of this object.|/RMD|
AbsolutePosition [readonly]
The distance, in pixels, from the top left corner of the game window under the Topbar.
AbsoluteRotation [readonly]
The absolute rotation of this gui object.
AbsoluteSize [readonly]
Size of the GUI element in pixels.
Localize [hidden]
Automatically set to true when a LocalizationTable's Root targets this object, or an ancestor of this object.
Inherited from Object Icon.pngInstance:
boolArchivable

Determines if an object can be Clone or saved to file.

|RMD member="API:Class/Instance/Archivable"|Determines if an object can be Clone or saved to file.|/RMD|
stringClassName [readonly]

The unique name of this type of Instance.

|RMD member="API:Class/Instance/ClassName"|The unique name of this type of Instance.|/RMD|
stringName

A non-unique identifier for the object.

|RMD member="API:Class/Instance/Name"|A non-unique identifier for the object.|/RMD|
Ref<Instance>Parent

The hierarchical parent of the object.

|RMD member="API:Class/Instance/Parent"|The hierarchical parent of the object.|/RMD|
intDataCost [LocalUserSecurity] [deprecated] [readonly]

Deprecated. Do not use.

|RMD member="API:Class/Instance/DataCost"|Deprecated. Do not use.|/RMD|
boolRobloxLocked [PluginSecurity]

If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.

|RMD member="API:Class/Instance/RobloxLocked"|If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.|/RMD|
boolarchivable [deprecated] [hidden]

Deprecated in favor of Archivable.

|RMD member="API:Class/Instance/archivable"|Deprecated in favor of Archivable.|/RMD|
stringclassName [deprecated] [readonly]

Deprecated in favor of ClassName.

|RMD member="API:Class/Instance/className"|Deprecated in favor of ClassName.|/RMD|
Determines if an object can be Clone or saved to file.
ClassName [readonly]
The unique name of this type of Instance.
A non-unique identifier for the object.
The hierarchical parent of the object.
DataCost [LocalUserSecurity] [deprecated] [readonly]
Deprecated. Do not use.
RobloxLocked [PluginSecurity]
If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.
archivable [deprecated] [hidden]
Deprecated in favor of Archivable.
className [deprecated] [readonly]
Deprecated in favor of ClassName.

Functions

FunctionsmemberhiddenFunctions [toggle]

Inherited from Object Icon.pngGuiObject:
boolTweenPosition ( UDim2 endPosition, EasingDirection easingDirection = Out, EasingStyle easingStyle = Quad, float time = 1, bool override = false, function(TweenStatus) callback = nil )

Smoothly moves a GUI to a new UDim2 position.

|RMD member="API:Class/GuiObject/TweenPosition"|Smoothly moves a GUI to a new UDim2 position.|/RMD|
boolTweenSize ( UDim2 endSize, EasingDirection easingDirection = Out, EasingStyle easingStyle = Quad, float time = 1, bool override = false, function(TweenStatus) callback = nil )

Smoothly resizes a GUI to a new UDim2.

|RMD member="API:Class/GuiObject/TweenSize"|Smoothly resizes a GUI to a new UDim2.|/RMD|
boolTweenSizeAndPosition ( UDim2 endSize, UDim2 endPosition, EasingDirection easingDirection = Out, EasingStyle easingStyle = Quad, float time = 1, bool override = false, function(TweenStatus) callback = nil )

Smoothly moves a GUI to a new size and position.

|RMD member="API:Class/GuiObject/TweenSizeAndPosition"|Smoothly moves a GUI to a new size and position.|/RMD|
TweenPosition ( UDim2 endPosition, EasingDirection easingDirection = Out, EasingStyle easingStyle = Quad, float time = 1, bool override = false, function(TweenStatus) callback = nil )
Smoothly moves a GUI to a new UDim2 position.
TweenSize ( UDim2 endSize, EasingDirection easingDirection = Out, EasingStyle easingStyle = Quad, float time = 1, bool override = false, function(TweenStatus) callback = nil )
Smoothly resizes a GUI to a new UDim2.
TweenSizeAndPosition ( UDim2 endSize, UDim2 endPosition, EasingDirection easingDirection = Out, EasingStyle easingStyle = Quad, float time = 1, bool override = false, function(TweenStatus) callback = nil )
Smoothly moves a GUI to a new size and position.
Inherited from Object Icon.pngInstance:
voidClearAllChildren ( )

Removes all descendants of the object.

|RMD member="API:Class/Instance/ClearAllChildren"|Removes all descendants of the object.|/RMD|
Ref<Instance>Clone ( )

Returns a copy of the object, including descendants, but only if the object is Archivable.

|RMD member="API:Class/Instance/Clone"|Returns a copy of the object, including descendants, but only if the object is Archivable.|/RMD|
voidDestroy ( )

Sets the Parent property to nil, locks the Parent property, disconnects all connections and calls Destroy() on all children.

|RMD member="API:Class/Instance/Destroy"|Sets the Parent property to nil, locks the Parent property, disconnects all connections and calls Destroy() on all children.|/RMD|
Ref<Instance>FindFirstAncestor ( string name )

Returns the first ancestor whose Name is equal to name, or nil if none can be found.

|RMD member="API:Class/Instance/FindFirstAncestor"|Returns the first ancestor whose Name is equal to name, or nil if none can be found.|/RMD|
Ref<Instance>FindFirstAncestorOfClass ( string className )

Returns the first ancestor whose ClassName is equal to className, or nil if none can be found.

|RMD member="API:Class/Instance/FindFirstAncestorOfClass"|Returns the first ancestor whose ClassName is equal to className, or nil if none can be found.|/RMD|
Ref<Instance>FindFirstAncestorWhichIsA ( string className )

Returns the first ancestor that inherits the class className, or nil if none can be found.

|RMD member="API:Class/Instance/FindFirstAncestorWhichIsA"|Returns the first ancestor that inherits the class className, or nil if none can be found.|/RMD|
Ref<Instance>FindFirstChild ( string name, bool recursive = false )

Returns the first child found with the given name, or nil if no such child exists. If the optional recursive argument is true, recursively descends the hierarchy while searching rather than only searching the immediate object.

|RMD member="API:Class/Instance/FindFirstChild"|Returns the first child found with the given name, or nil if no such child exists. If the optional recursive argument is true, recursively descends the hierarchy while searching rather than only searching the immediate object.|/RMD|
Ref<Instance>FindFirstChildOfClass ( string className )

Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.

|RMD member="API:Class/Instance/FindFirstChildOfClass"|Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.|/RMD|
Ref<Instance>FindFirstChildWhichIsA ( string className, bool recursive = false )

Returns the first child that inherits the class className, or nil if none can be found.

|RMD member="API:Class/Instance/FindFirstChildWhichIsA"|Returns the first child that inherits the class className, or nil if none can be found.|/RMD|
array<Instance>GetChildren ( )

Returns an array of the object's children.

|RMD member="API:Class/Instance/GetChildren"|Returns an array of the object's children.|/RMD|
array<Instance>GetDescendants ( )

Returns an array containing all of the descendants of the instance.

|RMD member="API:Class/Instance/GetDescendants"|Returns an array containing all of the descendants of the instance.|/RMD|
stringGetFullName ( )

Returns a string which shows the object's ancestry chain.

|RMD member="API:Class/Instance/GetFullName"|Returns a string which shows the object's ancestry chain.|/RMD|
RBXScriptSignalGetPropertyChangedSignal ( string property )

Returns a signal that is fired when the specified property is changed on this object.

|RMD member="API:Class/Instance/GetPropertyChangedSignal"|Returns a signal that is fired when the specified property is changed on this object.|/RMD|
boolIsA ( string className )

Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.

|RMD member="API:Class/Instance/IsA"|Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.|/RMD|
boolIsAncestorOf ( Instance descendant )

Returns true if the object is an ancestor of the given descendant.

|RMD member="API:Class/Instance/IsAncestorOf"|Returns true if the object is an ancestor of the given descendant.|/RMD|
boolIsDescendantOf ( Instance ancestor )

Returns true if the object is a descendant of the given ancestor.

|RMD member="API:Class/Instance/IsDescendantOf"|Returns true if the object is a descendant of the given ancestor.|/RMD|
Ref<Instance>WaitForChild ( string childName, double timeOut )

Yields the current thread until a child with the given name is found, then returns the child. If the timeOut parameter is specified, this function will time out and return nil if timeOut seconds elapse without the child being found.

|RMD member="API:Class/Instance/WaitForChild"|Yields the current thread until a child with the given name is found, then returns the child.

If the timeOut parameter is specified, this function will time out and return nil if timeOut seconds elapse without the child being found.|/RMD|

stringGetDebugId ( int scopeLength = 4 ) [PluginSecurity] [notbrowsable]

Returns a coded string of the object's DebugId used internally by Roblox.

|RMD member="API:Class/Instance/GetDebugId"|Returns a coded string of the object's DebugId used internally by Roblox.|/RMD|
voidRemove ( ) [deprecated]

Deprecated. Do not use.

|RMD member="API:Class/Instance/Remove"|Deprecated. Do not use.|/RMD|
array<Instance>children ( ) [deprecated]

Deprecated in favor of GetChildren.

|RMD member="API:Class/Instance/children"|Deprecated in favor of GetChildren.|/RMD|
Instanceclone ( ) [deprecated]

Deprecated in favor of Clone.

|RMD member="API:Class/Instance/clone"|Deprecated in favor of Clone.|/RMD|
voiddestroy ( ) [deprecated]

Deprecated in favor of Destroy.

|RMD member="API:Class/Instance/destroy"|Deprecated in favor of Destroy.|/RMD|
InstancefindFirstChild ( string name, bool recursive = false ) [deprecated]

Deprecated in favor of FindFirstChild.

|RMD member="API:Class/Instance/findFirstChild"|Deprecated in favor of FindFirstChild.|/RMD|
array<Instance>getChildren ( ) [deprecated]

Deprecated in favor of GetChildren.

|RMD member="API:Class/Instance/getChildren"|Deprecated in favor of GetChildren.|/RMD|
boolisA ( string className ) [deprecated]

Deprecated in favor of IsA.

|RMD member="API:Class/Instance/isA"|Deprecated in favor of IsA.|/RMD|
boolisDescendantOf ( Instance ancestor ) [deprecated]

Deprecated in favor of IsDescendantOf.

|RMD member="API:Class/Instance/isDescendantOf"|Deprecated in favor of IsDescendantOf.|/RMD|
voidremove ( ) [deprecated]

Deprecated in favor of Remove.

|RMD member="API:Class/Instance/remove"|Deprecated in favor of Remove.|/RMD|
Removes all descendants of the object.
Clone ( )
Returns a copy of the object, including descendants, but only if the object is Archivable.
Sets the Parent property to nil, locks the Parent property, disconnects all connections and calls Destroy() on all children.
Returns the first ancestor whose Name is equal to name, or nil if none can be found.
Returns the first ancestor whose ClassName is equal to className, or nil if none can be found.
Returns the first ancestor that inherits the class className, or nil if none can be found.
FindFirstChild ( string name, bool recursive = false )
Returns the first child found with the given name, or nil if no such child exists. If the optional recursive argument is true, recursively descends the hierarchy while searching rather than only searching the immediate object.
Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.
FindFirstChildWhichIsA ( string className, bool recursive = false )
Returns the first child that inherits the class className, or nil if none can be found.
Returns an array of the object's children.
Returns an array containing all of the descendants of the instance.
Returns a string which shows the object's ancestry chain.
Returns a signal that is fired when the specified property is changed on this object.
IsA ( string className )
Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.
IsAncestorOf ( Instance descendant )
Returns true if the object is an ancestor of the given descendant.
Returns true if the object is a descendant of the given ancestor.
WaitForChild ( string childName, double timeOut )
Yields the current thread until a child with the given name is found, then returns the child. If the timeOut parameter is specified, this function will time out and return nil if timeOut seconds elapse without the child being found.
GetDebugId ( int scopeLength = 4 ) [PluginSecurity] [notbrowsable]
Returns a coded string of the object's DebugId used internally by Roblox.
Remove ( ) [deprecated]
Deprecated. Do not use.
children ( ) [deprecated]
Deprecated in favor of GetChildren.
clone ( ) [deprecated]
Deprecated in favor of Clone.
destroy ( ) [deprecated]
Deprecated in favor of Destroy.
findFirstChild ( string name, bool recursive = false ) [deprecated]
Deprecated in favor of FindFirstChild.
getChildren ( ) [deprecated]
Deprecated in favor of GetChildren.
isA ( string className ) [deprecated]
Deprecated in favor of IsA.
isDescendantOf ( Instance ancestor ) [deprecated]
Deprecated in favor of IsDescendantOf.
remove ( ) [deprecated]
Deprecated in favor of Remove.


Events

EventsmemberhiddenEvents [toggle]

Inherited from Object Icon.pngGuiButton:
Activated ( InputObject inputObject )

Fires when the button is activated.

|RMD member="API:Class/GuiButton/Activated"|Fires when the button is activated.|/RMD|
MouseButton1Click ( )

Fired when the mouse has fully left clicked the GUI object. By clicking, the mouse has to be in bounds of the button and has to be pressed down and up again before this event fires.

|RMD member="API:Class/GuiButton/MouseButton1Click"|Fired when the mouse has fully left clicked the GUI object. By clicking, the mouse has to be in bounds of the button and has to be pressed down and up again before this event fires.|/RMD|
MouseButton1Down ( int x, int y )

Fired when the mouse is in the left mouse down state on the GUI object.

|RMD member="API:Class/GuiButton/MouseButton1Down"|Fired when the mouse is in the left mouse down state on the GUI object.|/RMD|
MouseButton1Up ( int x, int y )

Fired when the left mouse has released the GUI object.

|RMD member="API:Class/GuiButton/MouseButton1Up"|Fired when the left mouse has released the GUI object.|/RMD|
MouseButton2Click ( )

Fired when the mouse has right clicked the GUI object.

|RMD member="API:Class/GuiButton/MouseButton2Click"|Fired when the mouse has right clicked the GUI object.|/RMD|
MouseButton2Down ( int x, int y )

Fired when the mouse is in the right mouse down state on the GUI object.

|RMD member="API:Class/GuiButton/MouseButton2Down"|Fired when the mouse is in the right mouse down state on the GUI object.|/RMD|
MouseButton2Up ( int x, int y )

Fired when the right mouse button has been released on a GUI Object.

|RMD member="API:Class/GuiButton/MouseButton2Up"|Fired when the right mouse button has been released on a GUI Object.|/RMD|
Activated ( InputObject inputObject )
Fires when the button is activated.
Fired when the mouse has fully left clicked the GUI object. By clicking, the mouse has to be in bounds of the button and has to be pressed down and up again before this event fires.
Fired when the mouse is in the left mouse down state on the GUI object.
Fired when the left mouse has released the GUI object.
Fired when the mouse has right clicked the GUI object.
Fired when the mouse is in the right mouse down state on the GUI object.
Fired when the right mouse button has been released on a GUI Object.
Inherited from Object Icon.pngGuiObject:
DragBegin ( UDim2 initialPosition )

Fired when a player begins dragging the object. 'InitialPosition' is a UDim2 value of the position of the GuiObject before any drag operation began.

|RMD member="API:Class/GuiObject/DragBegin"|Fired when a player begins dragging the object. 'InitialPosition' is a UDim2 value of the position of the GuiObject before any drag operation began.|/RMD|
DragStopped ( int x, int y )

Fired when a player stops dragging the object. The arguments x and y represent the mouse's location.

|RMD member="API:Class/GuiObject/DragStopped"|Fired when a player stops dragging the object. The arguments x and y represent the mouse's location.|/RMD|
InputBegan ( InputObject input )

Fired when a user begins interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).

|RMD member="API:Class/GuiObject/InputBegan"|Fired when a user begins interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).|/RMD|
InputChanged ( InputObject input )

Fired when a user changes how they're interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).

|RMD member="API:Class/GuiObject/InputChanged"|Fired when a user changes how they're interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).|/RMD|
InputEnded ( InputObject input )

Fired when a user stops interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).

|RMD member="API:Class/GuiObject/InputEnded"|Fired when a user stops interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).|/RMD|
MouseEnter ( int x, int y )

Fires when a user moves their mouse into a GUI element.

|RMD member="API:Class/GuiObject/MouseEnter"|Fires when a user moves their mouse into a GUI element.|/RMD|
MouseLeave ( int x, int y )

Fires when a user moves their mouse out of a GUI element.

|RMD member="API:Class/GuiObject/MouseLeave"|Fires when a user moves their mouse out of a GUI element.|/RMD|
MouseMoved ( int x, int y )

Fires whenever a user moves their mouse while it is inside a GUI element.

|RMD member="API:Class/GuiObject/MouseMoved"|Fires whenever a user moves their mouse while it is inside a GUI element.|/RMD|
MouseWheelBackward ( int x, int y )

Fires when a user scrolls their mouse wheel back when the mouse is over a GUI element.

|RMD member="API:Class/GuiObject/MouseWheelBackward"|Fires when a user scrolls their mouse wheel back when the mouse is over a GUI element.|/RMD|
MouseWheelForward ( int x, int y )

Fires when a user scrolls their mouse wheel forward when the mouse is over a GUI element.

|RMD member="API:Class/GuiObject/MouseWheelForward"|Fires when a user scrolls their mouse wheel forward when the mouse is over a GUI element.|/RMD|
SelectionGained ( )

Fired when the GuiObject is being focused on with the Gamepad selector.

|RMD member="API:Class/GuiObject/SelectionGained"|Fired when the GuiObject is being focused on with the Gamepad selector.|/RMD|
SelectionLost ( )

Fired when the Gamepad selector stops focusing on the GuiObject.

|RMD member="API:Class/GuiObject/SelectionLost"|Fired when the Gamepad selector stops focusing on the GuiObject.|/RMD|
TouchLongPress ( array<Vector2> touchPositions, UserInputState state )

Fired when a user holds at least one finger for a short amount of time on the same position of a GUI object on a TouchEnabled device.

|RMD member="API:Class/GuiObject/TouchLongPress"|Fired when a user holds at least one finger for a short amount of time on the same position of a GUI object on a TouchEnabled device.|/RMD|
TouchPan ( array<Vector2> touchPositions, Vector2 totalTranslation, Vector2 velocity, UserInputState state )

Fired when a user drags at least one finger on a TouchEnabled device.

|RMD member="API:Class/GuiObject/TouchPan"|Fired when a user drags at least one finger on a TouchEnabled device.|/RMD|
TouchPinch ( array<Vector2> touchPositions, float scale, float velocity, UserInputState state )

Fired when a user pinches their fingers on a TouchEnabled device.

|RMD member="API:Class/GuiObject/TouchPinch"|Fired when a user pinches their fingers on a TouchEnabled device.|/RMD|
TouchRotate ( array<Vector2> touchPositions, float rotation, float velocity, UserInputState state )

Fired when a user rotates two fingers on a TouchEnabled device.

|RMD member="API:Class/GuiObject/TouchRotate"|Fired when a user rotates two fingers on a TouchEnabled device.|/RMD|
TouchSwipe ( SwipeDirection swipeDirection, int numberOfTouches )

Fired when a user swipes their fingers on a TouchEnabled device.

|RMD member="API:Class/GuiObject/TouchSwipe"|Fired when a user swipes their fingers on a TouchEnabled device.|/RMD|
TouchTap ( array touchPositions )

Fired when a user taps their finger on a TouchEnabled device. 'touchPositions' is a Lua array of Vector2, each indicating the position of all the fingers involved in the tap gesture. This event only fires locally. This event will always fire regardless of game state.

|RMD member="API:Class/GuiObject/TouchTap"|Fired when a user taps their finger on a TouchEnabled device. 'touchPositions' is a Lua array of Vector2, each indicating the position of all the fingers involved in the tap gesture. This event only fires locally. This event will always fire regardless of game state.|/RMD|
DragBegin ( UDim2 initialPosition )
Fired when a player begins dragging the object. 'InitialPosition' is a UDim2 value of the position of the GuiObject before any drag operation began.
Fired when a player stops dragging the object. The arguments x and y represent the mouse's location.
Fired when a user begins interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).
Fired when a user changes how they're interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).
Fired when a user stops interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc).
MouseEnter ( int x, int y )
Fires when a user moves their mouse into a GUI element.
MouseLeave ( int x, int y )
Fires when a user moves their mouse out of a GUI element.
MouseMoved ( int x, int y )
Fires whenever a user moves their mouse while it is inside a GUI element.
Fires when a user scrolls their mouse wheel back when the mouse is over a GUI element.
Fires when a user scrolls their mouse wheel forward when the mouse is over a GUI element.
Fired when the GuiObject is being focused on with the Gamepad selector.
Fired when the Gamepad selector stops focusing on the GuiObject.
TouchLongPress ( array<Vector2> touchPositions, UserInputState state )
Fired when a user holds at least one finger for a short amount of time on the same position of a GUI object on a TouchEnabled device.
TouchPan ( array<Vector2> touchPositions, Vector2 totalTranslation, Vector2 velocity, UserInputState state )
Fired when a user drags at least one finger on a TouchEnabled device.
TouchPinch ( array<Vector2> touchPositions, float scale, float velocity, UserInputState state )
Fired when a user pinches their fingers on a TouchEnabled device.
TouchRotate ( array<Vector2> touchPositions, float rotation, float velocity, UserInputState state )
Fired when a user rotates two fingers on a TouchEnabled device.
TouchSwipe ( SwipeDirection swipeDirection, int numberOfTouches )
Fired when a user swipes their fingers on a TouchEnabled device.
TouchTap ( array touchPositions )
Fired when a user taps their finger on a TouchEnabled device. 'touchPositions' is a Lua array of Vector2, each indicating the position of all the fingers involved in the tap gesture. This event only fires locally. This event will always fire regardless of game state.
Inherited from Object Icon.pngInstance:
AncestryChanged ( Instance child, Instance parent )

Fired when any of this object's ancestors change. First argument 'child' is the object whose parent changed. Second argument 'parent' is the first argument's new parent.

|RMD member="API:Class/Instance/AncestryChanged"|Fired when any of this object's ancestors change. First argument 'child' is the object whose parent changed. Second argument 'parent' is the first argument's new parent.|/RMD|
Changed ( string property )

Fired after a property changes value. The property argument is the name of the property

|RMD member="API:Class/Instance/Changed"|Fired after a property changes value. The property argument is the name of the property|/RMD|
ChildAdded ( Instance child )

Too many descriptions have already been loaded on this page

|RMD member="API:Class/Instance/ChildAdded"|Too many descriptions have already been loaded on this page|/RMD|
ChildRemoved ( Instance child )

Too many descriptions have already been loaded on this page

|RMD member="API:Class/Instance/ChildRemoved"|Too many descriptions have already been loaded on this page|/RMD|
DescendantAdded ( Instance descendant )

Fired after an Instance is parented to this object, or any of this object's descendants. The 'descendant' argument is the Instance that is being added.

|RMD member="API:Class/Instance/DescendantAdded"|Fired after an Instance is parented to this object, or any of this object's descendants. The 'descendant' argument is the Instance that is being added.|/RMD|
DescendantRemoving ( Instance descendant )

Fired after an Instance is unparented from this object, or any of this object's descendants. The 'descendant' argument is the Instance that is being added.

|RMD member="API:Class/Instance/DescendantRemoving"|Fired after an Instance is unparented from this object, or any of this object's descendants. The 'descendant' argument is the Instance that is being added.|/RMD|
childAdded ( Instance child ) [deprecated]

Deprecated in favor of ChildAdded.

|RMD member="API:Class/Instance/childAdded"|Deprecated in favor of ChildAdded.|/RMD|
Fired when any of this object's ancestors change. First argument 'child' is the object whose parent changed. Second argument 'parent' is the first argument's new parent.
Changed ( string property )
Fired after a property changes value. The property argument is the name of the property
Too many descriptions have already been loaded on this page
Too many descriptions have already been loaded on this page
DescendantAdded ( Instance descendant )
Fired after an Instance is parented to this object, or any of this object's descendants. The 'descendant' argument is the Instance that is being added.
Fired after an Instance is unparented from this object, or any of this object's descendants. The 'descendant' argument is the Instance that is being added.
childAdded ( Instance child ) [deprecated]
Deprecated in favor of ChildAdded.

|RMD member="API:Class/TextButton"|A TextButton is a GUI which can hold text, and can be interacted with by the player. |/RMD|



See also

Intro to GUIs