Skip to content
Roblox API Reference

TextButton

A 2D user interface element that displays interactive text.
Memory category
Gui
Own members
30
Inherited members
176
Subclasses
0
Siblings
2

Properties120

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Inherited fromGuiBase2d17

Property categoryData

Property categoryDebugging

Property categoryLocalization

Property categorySelection

Inherited fromGuiObject39

Property categoryAppearance

Property categoryBehavior

  • Determines if descendant GuiObjects outside of the bounds of a parent GUI element should render.
    • Read capabilities: UI
  • Deprecated: This property is deprecated. Use UIDragDetector instead, as it supports more input types and can be better customized.
    Determines whether a GuiObject (and its descendants) can be dragged around the screen.
    • Deprecated
    • Read capabilities: UI

Property categoryData

Property categoryEventReplicator

Property categorySelection

Property categoryState

Inherited fromGuiButton12

Property categoryData

Property categoryEventReplicator

Property categoryHaptic

Property categorySelection

  • A boolean property which indicates whether the object has been selected.
    • Read capabilities: UI
Defined byTextButton29

Property categoryData

  • TextButton.Confidential: boolean = false
    • Hidden
    • Not replicated
    • Not scriptable
    • Roblox engine security
    • Read capabilities: UI
  • TextButton.LocalizedText: string = ""
    Sets whether a TextButton should be GuiBase2d.Localize or not.
    • Hidden
    • Read only
    • Read capabilities: UI
    • Save only

Property categoryText

  • TextButton.ContentText: string = "Button"
    A copy of TextButton.Text that contains exactly what is being rendered by the TextButton.
    • Read only
    • Read capabilities: UI
  • TextButton.Font: Enum.Font = Enum.Font.Legacy
    Determines the font used to render text.
    • Hidden
    • Not replicated
    • Read capabilities: UI
    • Load only
  • TextButton.FontFace: Font
    Determines the font used to render text.
    • Read capabilities: UI
  • TextButton.LineHeight: number = 1
    Scales the spacing between lines of text in the TextButton.
    • Read capabilities: UI
  • TextButton.LocalizationMatchedSourceText: string = ""
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextButton.LocalizationMatchIdentifier: string = ""
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextButton.MaxVisibleGraphemes: number = -1
    The maximum number of graphemes the TextButton can show.
    • Read capabilities: UI
  • TextButton.OpenTypeFeatures: string = ""
    Applies OpenType font features, such as stylistic sets, to the text rendered by the TextButton.
    • Read capabilities: UI
  • TextButton.OpenTypeFeaturesError: string = ""
    Read-only property that contains the error message, if any, produced while applying OpenTypeFeatures.
    • Read only
    • Read capabilities: UI
    • Save only
  • TextButton.RichText: boolean = false
    Determines whether the TextButton renders its text using rich text formatting.
    • Read capabilities: UI
  • TextButton.Text: string = "Button"
    Determines the string rendered by the TextButton.
    • Read capabilities: UI
  • TextButton.TextBounds: Vector2 = Vector2.zero
    Read-only property which reflects the absolute size of rendered text in offsets.
    • Read only
    • Read capabilities: UI
  • TextButton.TextColor3: Color3 = Color3.new(0.105882, 0.164706, 0.207843)
    Determines the color of rendered text.
    • Read capabilities: UI
  • TextButton.TextDirection: Enum.TextDirection = Enum.TextDirection.Auto
    Direction in which the text is rendered.
    • Read capabilities: UI
  • TextButton.TextFits: boolean = false
    A boolean representation of whether the button's text fits within the size of it.
    • Read only
    • Read capabilities: UI
  • TextButton.TextScaled: boolean = false
    Changes whether text is resized to fit within the TextButton.
    • Read capabilities: UI
  • TextButton.TextSize: number = 8
    Determines the line height of text in offsets.
    • Read capabilities: UI
  • TextButton.TextStrokeColor3: Color3 = Color3.new(0, 0, 0)
    Determines the color of the text stroke (outline).
    • Read capabilities: UI
  • TextButton.TextStrokeTransparency: number = 1
    Determines the transparency of the text stroke (outline).
    • Read capabilities: UI
  • TextButton.TextTransparency: number = 0
    Determines the transparency of rendered text.
    • Read capabilities: UI
  • TextButton.TextTruncate: Enum.TextTruncate = Enum.TextTruncate.None
    Controls the truncation of the text displayed in the TextButton.
    • Read capabilities: UI
  • TextButton.TextWrapped: boolean = false
    Determines if text wraps to multiple lines within the TextButton element's space, truncating excess text.
    • Read capabilities: UI
  • TextButton.TextXAlignment: Enum.TextXAlignment = Enum.TextXAlignment.Center
    Determines the horizontal alignment of rendered text.
    • Read capabilities: UI
  • TextButton.TextYAlignment: Enum.TextYAlignment = Enum.TextYAlignment.Center
    Determines the vertical alignment of rendered text.
    • Read capabilities: UI
  • TextButton.FontSize: Enum.FontSize = Enum.FontSize.Size8
    Deprecated: This property is deprecated in favor of TextSize which is an integer and not an enum and thus offers far more options for sizes.
    Determines the font size to be used.
    • Deprecated
    • Not replicated
    • Read capabilities: UI
    • Load only

    Use TextSize instead.

  • TextButton.TextColor: BrickColor
    Deprecated: This item has been superseded by TextButton.TextColor3 which should be used in all new work.
    Determines the color of text.
    • Deprecated
    • Hidden
    • Not replicated
    • Read capabilities: UI
    • Load only
  • TextButton.TextWrap: boolean = false
    Deprecated: This item has been superseded by TextButton.TextWrapped which should be used in all new work.
    Determines whether or not text should wrap at the edges of the TextButton element's space.
    • Deprecated
    • Not replicated
    • Read capabilities: UI
    • Load only

    Use TextWrapped instead.

Methods49

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Inherited fromGuiObject6
Defined byTextButton1
  • TextButton:SetTextFromInput(text: string)
    • Roblox script security
    • Capabilities: UI
    Parameters
    Parameter
    text: string

Events37

Inherited fromObject1
Inherited fromInstance9
Inherited fromGuiBase2d1
Inherited fromGuiObject18
Inherited fromGuiButton8