Skip to content
Roblox API Reference

TextBox

A 2D user interface element that displays player-editable text.
Memory category
Gui
Own members
53
Inherited members
156
Subclasses
0
Siblings
12

Properties124

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

Defined byTextBox45

Property categoryData

  • TextBox.ClearTextOnFocus: boolean = true
    Determines whether clicking on the TextBox will clear its TextBox.Text property.
    • Read capabilities: UI
  • TextBox.Confidential: boolean = false
    • Hidden
    • Not replicated
    • Not scriptable
    • Roblox engine security
    • Read capabilities: UI
  • TextBox.CursorPosition: number = 1
    Determines the offset of the text cursor in bytes, or -1 if there is no cursor.
    • Read capabilities: UI
  • TextBox.HasFocus: boolean = false
    • Hidden
    • Not scriptable
    • Read only
    • Roblox engine security
    • Read capabilities: UI
  • TextBox.ManualFocusRelease: boolean = false
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextBox.MultiLine: boolean = false
    When set to true, text inside a TextBox is able to move onto multiple lines.
    • Read capabilities: UI
  • TextBox.OverlayNativeInput: boolean = false
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextBox.SelectionStart: number = -1
    Determines the starting position of a text selection.
    • Read capabilities: UI
  • TextBox.ShouldEmitReturnEvents: boolean = false
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextBox.ShouldEmitTabEvents: boolean = false
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextBox.ShouldEmitUpAndDownArrowEvents: boolean = false
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextBox.ShowNativeInput: boolean = true
    If set to true, input native to the platform is used instead of Roblox's built-in keyboard.
    • Read capabilities: UI
  • TextBox.TextEditable: boolean = true
    Determines whether the player can change the Text.
    • Read capabilities: UI
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI

Property categoryText

  • TextBox.ContentText: string = "TextBox"
    A copy of TextBox.Text that contains exactly what is being rendered by the TextBox.
    • Read only
    • Read capabilities: UI
  • TextBox.Font: Enum.Font = Enum.Font.Legacy
    Determines the font used to render text.
    • Hidden
    • Not replicated
    • Read capabilities: UI
    • Load only
  • TextBox.FontFace: Font
    Determines the font face used to render text.
    • Read capabilities: UI
  • TextBox.LineHeight: number = 1
    Scales the spacing between lines of text in the TextBox.
    • Read capabilities: UI
  • TextBox.LocalizationMatchedSourceText: string = ""
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextBox.LocalizationMatchIdentifier: string = ""
    • Hidden
    • Not replicated
    • Roblox script security
    • Read capabilities: UI
  • TextBox.LocalizedPlaceholderText: string = ""
    • Hidden
    • Not scriptable
    • Read only
    • Roblox engine security
    • Read capabilities: UI
  • TextBox.MaxVisibleGraphemes: number = -1
    The maximum number of graphemes the TextBox can show.
    • Read capabilities: UI
  • TextBox.OpenTypeFeatures: string = ""
    Applies OpenType typographic features to the text rendered by the TextBox.
    • Read capabilities: UI
  • TextBox.OpenTypeFeaturesError: string = ""
    Read-only property that describes why the TextBox.OpenTypeFeatures string could not be applied.
    • Read only
    • Read capabilities: UI
    • Save only
  • TextBox.PlaceholderColor3: Color3 = Color3.new(0.5, 0.5, 0.5)
    Sets the text color that gets used when no text has been entered into the TextBox.
    • Read capabilities: UI
  • TextBox.PlaceholderText: string = ""
    Sets the text that gets displayed when no text has been entered into the TextBox.
    • Read capabilities: UI
  • TextBox.RichText: boolean = false
    Determines whether the TextBox renders the Text string using rich text formatting.
    • Read capabilities: UI
  • TextBox.Text: string = "TextBox"
    Determines the string rendered by the TextBox element.
    • Read capabilities: UI
  • TextBox.TextBounds: Vector2 = Vector2.zero
    The size of a TextBox element's text in offsets.
    • Read only
    • Read capabilities: UI
  • TextBox.TextColor3: Color3 = Color3.new(0.105882, 0.164706, 0.207843)
    Determines the color of non-placeholder rendered text.
    • Read capabilities: UI
  • Direction in which the text is rendered.
    • Read capabilities: UI
  • TextBox.TextFits: boolean = false
    Whether the text fits within the constraints of the TextBox.
    • Read only
    • Read capabilities: UI
  • TextBox.TextScaled: boolean = false
    Changes whether text is resized to fit within the TextBox.
    • Read capabilities: UI
  • TextBox.TextSize: number = 8
    Determine the line height of text in offsets.
    • Read capabilities: UI
  • TextBox.TextStrokeColor3: Color3 = Color3.new(0, 0, 0)
    Determines the color of the text stroke (outline).
    • Read capabilities: UI
  • TextBox.TextStrokeTransparency: number = 1
    Determines the transparency of the text stroke (outline).
    • Read capabilities: UI
  • TextBox.TextTransparency: number = 0
    Determines the transparency of the rendered text.
    • Read capabilities: UI
  • Controls the truncation of the text displayed in the TextBox.
    • Read capabilities: UI
  • TextBox.TextWrapped: boolean = false
    Determines if text wraps to multiple lines within the TextBox element space, truncating excess text.
    • Read capabilities: UI
  • Determines the horizontal alignment of the rendered text.
    • Read capabilities: UI
  • Determines the vertical alignment of the rendered text.
    • Read capabilities: UI
  • Deprecated: This item has been superseded by TextBox.TextSize which should be used in all new work.
    Determines the font size of a TextBox object.
    • Deprecated
    • Not replicated
    • Read capabilities: UI
    • Load only

    Use TextSize instead.

  • TextBox.TextColor: BrickColor
    Deprecated: This item has been superseded by TextBox.TextColor3 which should be used in all new work.
    • Deprecated
    • Hidden
    • Not replicated
    • Read capabilities: UI
    • Load only
  • TextBox.TextWrap: boolean = false
    Deprecated: This item has been superseded by TextBox.TextWrapped which should be used in all new work.
    • Deprecated
    • Not replicated
    • Read capabilities: UI
    • Load only

    Use TextWrapped instead.

Methods53

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 byTextBox5
  • TextBox:CaptureFocus()
    Forces the client to focus on the TextBox.
    • Capabilities: UI
  • TextBox:IsFocused(): boolean
    Whether the TextBox currently has focus.
    • Capabilities: UI
    Returns
    TypeDescription
    boolean
    Returns true if the TextBox is focused or false if it is not.
  • TextBox:ReleaseFocus(submitted: boolean? = false)
    Forces the client to unfocus the TextBox.
    • Capabilities: UI
    Parameters
    ParameterDescription
    submitted: boolean? = false
    Whether the TextBox.FocusLost event's enterPressed parameter reports true, as if the player pressed Enter to submit text. Defaults to false.
  • TextBox:ResetKeyboardMode()
    • Roblox script security
    • Capabilities: UI
  • TextBox:SetTextFromInput(text: string)
    • Roblox script security
    • Capabilities: UI
    Parameters
    Parameter
    text: string

Events32

Inherited fromObject1
Inherited fromInstance9
Inherited fromGuiBase2d1
Inherited fromGuiObject18
Defined byTextBox3