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

TextBox

Show deprecated

TextBox

Show deprecated

A GUI object which allows you to type within its boundaries.

TextBox is specifically meant for user input.

Unlike TextLabel, TextBoxes will not be translated by LocalizationService because it’s text is assumed to be user input. For a text field that is not meant for user input TextLabel should be used.


Properties

bool

ClearTextOnFocus

Determines whether clicking on the TextBox will clear its TextBox/Text property

int

CursorPosition

Font

Font

Determines the font used to render text

float

LineHeight

Scales the spacing between lines of text in the TextBox.

bool

MultiLine

When set to true, text inside a TextBox is able to move onto multiple lines. This also enables players to use the enter key to move onto a new line.

Color3

PlaceholderColor3

Sets the text color that gets used when no text has been entered into the TextBox yet.

string

PlaceholderText

Sets the text that gets displayed when no text has been entered into the TextBox yet.

int

SelectionStart

bool

ShowNativeInput

If set to true, input native to the platform is used instead of Roblox’s built-in keyboard.

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

TextEditable

bool

TextFits

[ReadOnly] [NotReplicated]

Whether the text fits within the constraints of the TextBox.

bool

TextScaled

Changes whether text is resized to fit the GUI object that renders it.

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

bool

TextWrapped

Determines if text wraps to multiple lines within the GuiObject|GUI element space, truncating excess text

TextXAlignment

TextXAlignment

Determines the horizontal alignment of rendered text.

TextYAlignment

TextYAlignment

Determines the vertical alignment of rendered text.

Functions

void

CaptureFocus ( )

Forces the client to focus on the TextBox.

bool

IsFocused ( )

Returns true if the textbox is focused, or false if it is not.

void

ReleaseFocus ( bool submitted )

Forces the client to unfocus the TextBox.

Events

RBXScriptSignal

FocusLost ( bool enterPressed , Instance inputThatCausedFocusLoss )

The FocusLost event fires when the client lets their focus off the /TextBox.

RBXScriptSignal

Focused ( )

Fires when the /TextBox gains focus.