PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

TextButton

Show deprecated

TextButton

Show deprecated

A TextButton behaves similarly to TextLabel in regards to rendering with the additional behaviors of a GuiButton. It defines the same text-rendering properties as a TextLabel does.

You can disable text rendering by setting TextButton/TextTransparency to 1. This will leave you with a plain rectangle that can be used as a button.

Properties

Font

Font

Determines the font used to render text.

float

LineHeight

Scales the spacing between lines of text in the TextButton.

string

LocalizedText

[Hidden] [ReadOnly] [NotReplicated]

Sets whether a TextButton should be GuiBase2d/Localize or not.

string

Text

Determines the string rendered by the UI element.

Vector2

TextBounds

[ReadOnly] [NotReplicated]

The pixel size of a UI element’s text.

Color3

TextColor3

Determines the color of rendered text.

bool

TextFits

[ReadOnly] [NotReplicated]

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

bool

TextScaled

Changes whether text is resized to fit within the TextButton.

float

TextSize

Determine the line height of text in pixels.

Color3

TextStrokeColor3

Determines the color of the text stroke (outline).

float

TextStrokeTransparency

Determines the transparency of the text stroke (outline).

float

TextTransparency

Determines the transparency of rendered text.

TextTruncate

TextTruncate

Controls the truncation of the text displayed in this TextButton.

bool

TextWrapped

Determines if text wraps to multiple lines within the UI element space, truncating excess text.

TextXAlignment

TextXAlignment

Determines the horizontal alignment of rendered text.

TextYAlignment

TextYAlignment

Determines the vertical alignment of rendered text.

Inherited from GuiButton: Show Hide

ButtonStyle

Style

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

Selected

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

Modal

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

AutoButtonColor

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

Inherited from GuiObject: Show Hide

int

ZIndex

Determines the order of UI element rendering
bool

Visible

Determines whether a UI element and its descendants will be rendered.
float

Transparency

[Hidden] [NotReplicated]
A mixed property of BackgroundTransparency and TextTransparency
SizeConstraint

SizeConstraint

Selects the Size axes that a UI element that will be based on the parent Size
UDim2

Size

Determine the pixel and scalar size of a UI element, relative to its parent.
GuiObject

SelectionImageObject

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

Selectable

Determine whether the object can be selected by a gamepad.
float

Rotation

Determines the number of degrees by which a UI element is rotated.
UDim2

Position

Determine the pixel and scalar position of a UI element, relative to its parent.
GuiObject

NextSelectionUp

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

NextSelectionRight

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

NextSelectionLeft

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

NextSelectionDown

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

LayoutOrder

Controls the sort order of a GuiObject when used with a UIGridStyleLayout
bool

ClipsDescendants

Determines if descendant UI elements outside of the bounds of a UI element should be invisible
int

BorderSizePixel

Determines the pixel width of a UI element's border.
Color3

BorderColor3

Determines the color of a UI element's border.
float

BackgroundTransparency

Determines the transparency of the background of a GUI element.
Color3

BackgroundColor3

Determines the color of a UI element's background.
Vector2

AnchorPoint

Determines the origin point of a UI element, relative to its absolute size.
bool

Active

Determines whether a UI element sinks input

Inherited from GuiBase2d: Show Hide

LocalizationTable

RootLocalizationTable

A reference to a `LocalizationTable` to be used to apply automated localization to this GuiBase2d and its descendants.
bool

AutoLocalize

When set to true, localization will be applied to this GuiBase2d and its descendants based on the `GuiBase2d/RootLocalizationTable` specified for this GuiBase2d.
Vector2

AbsoluteSize

[ReadOnly] [NotReplicated]
Describes the actual screen size of a UI element, in pixels.
float

AbsoluteRotation

[ReadOnly] [NotReplicated]
Describes the actual screen rotation of a UI element, in degrees.
Vector2

AbsolutePosition

[ReadOnly] [NotReplicated]
Describes the actual screen position of a UI element, in pixels.

Inherited from Instance: Show Hide

int

DataCost

[ReadOnly] [NotReplicated]
The cost of saving the instance using data persistence.
Instance

Parent

Determines the hierarchical parent of the `Instance`.
bool

RobloxLocked

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

ClassName

[ReadOnly] [NotReplicated]
A read-only string representing the class this `Instance` belongs to.
string

Name

A non-unique identifier of the `Instance`.
bool

Archivable

Determines if an `Instance` can be cloned using `/Instance/Clone` or saved to file.

Functions

Inherited from GuiObject: Show Hide

bool

TweenPosition ( UDim2 endPosition , EasingDirection easingDirection , EasingStyle easingStyle , float time , bool override , Function callback )

Smoothly moves a GUI to a new `DataType/UDim2`
bool

TweenSize ( UDim2 endSize , EasingDirection easingDirection , EasingStyle easingStyle , float time , bool override , Function callback )

Smoothly resizes a GUI to a new UDim2.
bool

TweenSizeAndPosition ( UDim2 endSize , UDim2 endPosition , EasingDirection easingDirection , EasingStyle easingStyle , float time , bool override , Function callback )

Smoothly moves a GUI to a new size and position.

Inherited from Instance: Show Hide

RBXScriptSignal

GetPropertyChangedSignal ( string property )

Get an event that fires when a given property of an object changes.
Instance

FindFirstChildWhichIsA ( string className , bool recursive )

Returns the first child of the `Instance` for whom `Instance/IsA` returns true for the given className.
Array

GetDescendants ( )

[CustomLuaState]
Returns an array containing all of the `Instance`'s descendants.
bool

IsAncestorOf ( Instance descendant )

Returns true if an `Instance` is an ancestor of the given descendant.
bool

IsDescendantOf ( Instance ancestor )

Returns true if an `Instance` is a descendant of the given ancestor.
Instance

FindFirstChildOfClass ( string className )

Returns the first child of the `Instance` whose `Instance/ClassName|ClassName` is equal to the given className.
Instance

FindFirstChild ( string name , bool recursive )

Returns the first child of the `Instance` found with the given name.
Instance

FindFirstAncestorWhichIsA ( string className )

Returns the first ancestor of the `Instance` for whom `Instance/IsA` returns true for the given className.
Instance

FindFirstAncestorOfClass ( string className )

Returns the first ancestor of the `Instance` whose `Instance/ClassName` is equal to the given className.
Instance

FindFirstAncestor ( string name )

Returns the first ancestor of the `Instance` whose `Instance/Name` is equal to the given name.
bool

IsA ( string className )

Returns true if an `Instance`'s class matches or inherits from a given class
Instance

WaitForChild ( string childName , double timeOut )

[CustomLuaState] [CanYield]
Returns the child of the `Instance` with the given name. If the child does not exist, it will yield the current thread until it does.
string

GetFullName ( )

Returns a string showing the `Instance`'s ancestry.
string

GetDebugId ( int scopeLength )

[NotBrowsable]
Returns a coded string of the `Instance`s DebugId used internally by Roblox.
Objects

GetChildren ( )

Returns an array containing all of the `Instance`'s children.
void

Destroy ( )

Sets the `Instance/Parent` property to nil, locks the `Instance/Parent` property, disconnects all connections and calls Destroy on all children.
Instance

Clone ( )

Create a deep copy of a Roblox instance and descendants where `Archivable = true`.
void

ClearAllChildren ( )

This function destroys all of an `Instance`'s children.

Events

Inherited from GuiButton: Show Hide

RBXScriptSignal

MouseButton2Up ( int x , int y )

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

MouseButton2Down ( int x , int y )

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

MouseButton2Click ( )

Fired when the mouse has right clicked the GUI object.
RBXScriptSignal

MouseButton1Up ( int x , int y )

Fired when the left mouse has released the GUI object.
RBXScriptSignal

MouseButton1Down ( int x , int y )

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

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.
RBXScriptSignal

Activated ( Instance inputObject )

Fires when the button is activated.

Inherited from GuiObject: Show Hide

RBXScriptSignal

TouchTap ( Array touchPositions )

Fires when the player performs a tap gesture on the UI element
RBXScriptSignal

TouchSwipe ( SwipeDirection swipeDirection , int numberOfTouches )

Fires when the player performs a swipe gesture on the UI element
RBXScriptSignal

TouchRotate ( Array touchPositions , float rotation , float velocity , UserInputState state )

Fires when the player performs a rotation gesture using two fingers on the UI element
RBXScriptSignal

TouchPinch ( Array touchPositions , float scale , float velocity , UserInputState state )

Fires when the player performs a pinch or pull gesture using two fingers on the UI element
RBXScriptSignal

TouchPan ( Array touchPositions , Vector2 totalTranslation , Vector2 velocity , UserInputState state )

Fires when the player moves their finger on the UI element
RBXScriptSignal

TouchLongPress ( Array touchPositions , UserInputState state )

Fires when the player starts, continues and stops long-pressing the UI element
RBXScriptSignal

SelectionLost ( )

Fired when the Gamepad selector stops focusing on the GuiObject.
RBXScriptSignal

SelectionGained ( )

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

MouseWheelForward ( int x , int y )

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

MouseWheelBackward ( int x , int y )

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

MouseMoved ( int x , int y )

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

MouseLeave ( int x , int y )

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

MouseEnter ( int x , int y )

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

InputEnded ( Instance input )

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

InputChanged ( Instance 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).
RBXScriptSignal

InputBegan ( Instance input )

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

Inherited from Instance: Show Hide

RBXScriptSignal

DescendantRemoving ( Instance descendant )

Fires immediately before a descendant of the `Instance` is removed.
RBXScriptSignal

AncestryChanged ( Instance child , Instance parent )

Fires when the `Instance/Parent` property of the object or one of its ancestors is changed.
RBXScriptSignal

ChildAdded ( Instance child )

Fires when an object is parented to this `Instance`.
RBXScriptSignal

ChildRemoved ( Instance child )

Fires when a child is removed from this `Instance`.
RBXScriptSignal

DescendantAdded ( Instance descendant )

Fires when a descendant is added to the `Instance`.
RBXScriptSignal

Changed ( string property )

Fired immediately after a property of an object changes.