TextBox
A 2D user interface element that displays player-editable text.
| Memory category | Gui |
|---|
Member index 52
Removed member index 3
| History | Member | |
|---|---|---|
| 466 | Content: string | |
| 402 | IsPassword: bool |
Description
A TextBox allows the player to provide text input. It behaves similarly to a
TextButton, except that a single TextBox can be put in focus by
clicking, tapping, or gamepad selection. While in focus, the player can use a
keyboard to change the Text property.
- If there is no text, the PlaceholderText will be visible. This is useful prompting players of the kind or format of data they should input.
- By default, the ClearTextOnFocus property
is enabled and ensures there is no existing text when a
TextBoxis focused. This may not be desirable for text that should be editable by the player. - The MultiLine property allows players to enter
multiple lines of text with newline characters (
\n).
Focus State
It is possible to detect and change the focus state of a TextBox:
- You can use CaptureFocus when a dialogue
appears so that the player doesn't have to click on a
TextBoxwhen it becomes available; you can use ContextActionService:BindAction() to bind a certain key to focus aTextBoxusing this function. When aTextBoxcomes into focus, the Focused event fires. - You can detect if a certain
TextBoxis in focus by using IsFocused. Alternatively, UserInputService:GetFocusedTextBox() can be used to check if anyTextBoxis in focus. - When the player is done inputting text, the FocusLost event fires, indicating if the user pressed Enter to submit text along with the InputObject that caused the loss of focus. When using on screen keyboards on mobile and console, ReturnPressedFromOnScreenKeyboard may also fire.
- If some more important matter comes up during gameplay, you can
ReleaseFocus of the
TextBoxso that a player's keyboard input returns to your game.
Text Editing
A TextBox supports text selection through its
CursorPosition and
SelectionStart properties. Using
GetPropertyChangedSignal, you can
detect when a selection changes. Additionally, it is possible for players to
copy and paste text within a TextBox, enabling basic clipboard support.
Text Filtering Notice Games that facilitate player-to-player communication using text, such as custom chat or nametags, must properly filter such text using TextService:FilterStringAsync() or Chat:FilterStringAsync(). If this is not properly done, your game may receive moderation action.
History 214
- 681 Add
- 679 Add
- 670 Change Tags of from [] to [Hidden, NotReplicated]
- 670 Change CanSave of from true to false
- 670 Change CanLoad of from true to false
- 670 Change Tags of from [] to [Hidden, NotReplicated]
- 670 Change CanSave of from true to false
- 670 Change CanLoad of from true to false
- 662 Add
- 655 Add
- 629 Add OpenTypeFeaturesError
- 629 Add OpenTypeFeatures
- 605 Change WriteSecurity of from RobloxSecurity to RobloxScriptSecurity
- 605 Change Tags of from [Hidden, NotReplicated, NotScriptable] to [Hidden, NotReplicated]
- 605 Change ReadSecurity of from RobloxSecurity to RobloxScriptSecurity
- 605 Change Tags of from [Hidden, NotReplicated, NotScriptable] to [Hidden, NotReplicated]
- 605 Change ReadSecurity of from RobloxSecurity to RobloxScriptSecurity
- 605 Change WriteSecurity of from RobloxSecurity to RobloxScriptSecurity
- 603 Add
- 603 Add
- 581 Add TextDirection
- 573 Change ReturnType of SetTextFromInput from void to null
- 573 Change ReturnType of ResetKeyboardMode from void to null
- 573 Change ReturnType of ReleaseFocus from void to null
- 573 Change ReturnType of CaptureFocus from void to null
- 558 Change Tags of from [Hidden] to [Hidden, NotReplicated]
- 558 Change CanSave of from true to false
- 553 Change Default of TextYAlignment from to Center
- 553 Change Default of TextXAlignment from to Center
- 553 Change Default of TextWrapped from to false
- 553 Change Default of TextWrap from to false
- 553 Change PreferredDescriptor of TextWrap from to TextWrapped
- 553 Change Default of TextTruncate from to None
- 553 Change Default of TextTransparency from to 0
- 553 Change Default of TextStrokeTransparency from to 1
- 553 Change Default of TextStrokeColor3 from to Color3(0, 0, 0)
- 553 Change Default of TextSize from to 8
- 553 Change Default of TextScaled from to false
- 553 Change Default of from to Default
- 553 Change Default of TextFits from to false
- 553 Change Default of TextEditable from to true
- 553 Change Default of TextColor3 from to Color3(0.105882, 0.164706, 0.207843)
- 553 Change Default of from to
- 553 Change Default of TextBounds from to Vector2(0, 0)
- 553 Change Default of Text from to TextBox
- 553 Change Default of ShowNativeInput from to true
- 553 Change Default of SelectionStart from to -1
- 553 Change Default of RichText from to false
- 553 Change Default of from to Default
- 553 Change Default of PlaceholderColor3 from to Color3(0.7, 0.7, 0.7)
- 553 Change Default of from to false
- 553 Change Default of MultiLine from to false
- 553 Change Default of MaxVisibleGraphemes from to -1
- 553 Change Default of from to false
- 553 Change Default of LineHeight from to 1
- 553 Change Default of FontSize from to Size8
- 553 Change PreferredDescriptor of FontSize from to TextSize
- 553 Change Default of FontFace from to
- 553 Change Default of from to Legacy
- 553 Change Default of CursorPosition from to 1
- 553 Change Default of ContentText from to TextBox
- 553 Add
- 553 Change Default of ClearTextOnFocus from to true
- 549 Change Tags of from [] to [Hidden]
- 539 Remove
- 517 Add FontFace
- 501 Add ContentText
- 486 Change ThreadSafety of TextYAlignment from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextXAlignment from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextWrapped from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextWrap from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextTruncate from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextTransparency from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextStrokeTransparency from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextStrokeColor3 from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextSize from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextScaled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextFits from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextEditable from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextColor3 from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextBounds from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Text from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ShowNativeInput from ReadOnly to ReadSafe
- 486 Change ThreadSafety of SelectionStart from ReadOnly to ReadSafe
- 486 Change ThreadSafety of RichText from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of PlaceholderText from ReadOnly to ReadSafe
- 486 Change ThreadSafety of PlaceholderColor3 from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MultiLine from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxVisibleGraphemes from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of LineHeight from ReadOnly to ReadSafe
- 486 Change ThreadSafety of FontSize from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of CursorPosition from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ClearTextOnFocus from ReadOnly to ReadSafe
- 483 Change Parameters of FocusLost from (enterPressed: bool, inputThatCausedFocusLoss: Instance) to (enterPressed: bool, inputThatCausedFocusLoss: InputObject)
- 469 Change Tags of from [NotReplicated] to [Hidden, NotReplicated]
- 469 Change CanLoad of from true to false
- 469 Change Tags of from [NotReplicated] to [Hidden, NotReplicated]
- 469 Change CanLoad of from true to false
- 469 Change Tags of from [NotReplicated] to [Hidden, NotReplicated]
- 469 Change CanLoad of from true to false
- 469 Add MaxVisibleGraphemes
- 469 Change Tags of from [NotReplicated] to [Hidden, NotReplicated]
- 469 Change CanLoad of from true to false
- 469 Change Tags of from [NotReplicated] to [Hidden, NotReplicated]
- 469 Change CanLoad of from true to false
- 466 Remove Content
- 465 Add Content
- 462 Change ThreadSafety of ReturnPressedFromOnScreenKeyboard from to Unsafe
- 462 Change ThreadSafety of Focused from to Unsafe
- 462 Change ThreadSafety of FocusLost from to Unsafe
- 462 Change ThreadSafety of SetTextFromInput from to Unsafe
- 462 Change ThreadSafety of ResetKeyboardMode from to Unsafe
- 462 Change ThreadSafety of ReleaseFocus from to Unsafe
- 462 Change ThreadSafety of IsFocused from to Unsafe
- 462 Change ThreadSafety of CaptureFocus from to Unsafe
- 462 Change ThreadSafety of TextYAlignment from to ReadOnly
- 462 Change ThreadSafety of TextXAlignment from to ReadOnly
- 462 Change ThreadSafety of TextWrapped from to ReadOnly
- 462 Change ThreadSafety of TextWrap from to ReadOnly
- 462 Change ThreadSafety of TextTruncate from to ReadOnly
- 462 Change ThreadSafety of TextTransparency from to ReadOnly
- 462 Change ThreadSafety of TextStrokeTransparency from to ReadOnly
- 462 Change ThreadSafety of TextStrokeColor3 from to ReadOnly
- 462 Change ThreadSafety of TextSize from to ReadOnly
- 462 Change ThreadSafety of TextScaled from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of TextFits from to ReadOnly
- 462 Change ThreadSafety of TextEditable from to ReadOnly
- 462 Change ThreadSafety of TextColor3 from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of TextBounds from to ReadOnly
- 462 Change ThreadSafety of Text from to ReadOnly
- 462 Change ThreadSafety of ShowNativeInput from to ReadOnly
- 462 Change ThreadSafety of SelectionStart from to ReadOnly
- 462 Change ThreadSafety of RichText from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of PlaceholderText from to ReadOnly
- 462 Change ThreadSafety of PlaceholderColor3 from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of MultiLine from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of LineHeight from to ReadOnly
- 462 Change ThreadSafety of FontSize from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of CursorPosition from to ReadOnly
- 462 Change ThreadSafety of ClearTextOnFocus from to ReadOnly
- 454 Change MemoryCategory of TextBox from Instances to Gui
- 452 Change MemoryCategory of TextBox from Gui to Instances
- 453 Change MemoryCategory of TextBox from Instances to Gui
- 438 Add RichText
- 405 Add ReturnPressedFromOnScreenKeyboard
- 405 Add
- 403 Change Tags of from [] to [NotReplicated]
- 403 Change CanSave of from true to false
- 403 Add
- 402 Remove IsPassword
- 398 Add
- 391 Add TextEditable
- 391 Add SelectionStart
- 380 Add IsPassword
- 361 Add CursorPosition
- 326 Add TextTruncate
- 325 Add ResetKeyboardMode
- 317 Add LineHeight
- 310 Change WriteSecurity of PlaceholderText from RobloxScriptSecurity to None
- 310 Change ReadSecurity of PlaceholderText from RobloxScriptSecurity to None
- 310 Change WriteSecurity of PlaceholderColor3 from RobloxScriptSecurity to None
- 310 Change ReadSecurity of PlaceholderColor3 from RobloxScriptSecurity to None
- 297 Add
- 294 Add PlaceholderText
- 294 Add PlaceholderColor3
- 290 Change WriteSecurity of from None to RobloxScriptSecurity
- 290 Change ReadSecurity of from None to RobloxScriptSecurity
- 290 Change Tags of FontSize from [NotReplicated] to [NotReplicated, Deprecated]
- 287 Add
- 272 Add ShowNativeInput
- 268 Add SetTextFromInput
- 263 Add TextSize
- 246 Change Parameters of ReleaseFocus from () to (submitted: bool = false)
- 213 Add IsFocused
- 208 Change Parameters of FocusLost from (enterPressed: bool) to (enterPressed: bool, inputThatCausedFocusLoss: Instance)
- 201 Add ReleaseFocus
- 190 Add Focused
- 127 Change Security of CaptureFocus from RobloxScriptSecurity to None
- 55 Change Tags of TextBox from [preliminary] to []
- 51 Add TextWrapped
- 51 Change Tags of TextWrap from [NotReplicated] to [NotReplicated, Deprecated]
- 50 Add TextScaled
- 48 Add TextStrokeTransparency
- 48 Add TextStrokeColor3
- 47 Add FocusLost
- 47 Add CaptureFocus
- 47 Add TextYAlignment
- 47 Add TextXAlignment
- 47 Add TextWrap
- 47 Add TextTransparency
- 47 Add TextFits
- 47 Add TextColor3
- 47 Add
- 47 Add TextBounds
- 47 Add Text
- 47 Add MultiLine
- 47 Add FontSize
- 47 Add
- 47 Add ClearTextOnFocus
- 47 Add TextBox
Members 52
CaptureFocus
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| null | ||
Forces the client to focus on the TextBox.
| Thread safety | Unsafe |
|---|
History 4
- 573 Change ReturnType of CaptureFocus from void to null
- 462 Change ThreadSafety of CaptureFocus from to Unsafe
- 127 Change Security of CaptureFocus from RobloxScriptSecurity to None
- 47 Add CaptureFocus
ClearTextOnFocus
| Type | Default | |
|---|---|---|
| bool | true | |
Determines whether clicking on the TextBox will clear its
TextBox.Text property
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
History 4
- 553 Change Default of ClearTextOnFocus from to true
- 486 Change ThreadSafety of ClearTextOnFocus from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ClearTextOnFocus from to ReadOnly
- 47 Add ClearTextOnFocus
ContentText
| Type | Default | |
|---|---|---|
| string | TextBox | |
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | false |
History 2
- 553 Change Default of ContentText from to TextBox
- 501 Add ContentText
CursorPosition
| Type | Default | |
|---|---|---|
| int | 1 | |
This property determines the offset of the text cursor in bytes, or -1
if the TextBox is not currently being edited. A value of 1 represents
the position before the first byte in the Text
property. When used in conjunction with the
SelectionStart property, it is possible to
both get and set selected text within a TextBox.
Note that the units of this property are bytes and that many unicode
characters such as emoji are longer than 1 byte. For instance, if a player
types in "Hello👋" ("Hello" immediately followed by the waving hand sign),
the cursor position would be 10, not 7, since the emoji uses 4 bytes.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | false |
History 4
- 553 Change Default of CursorPosition from to 1
- 486 Change ThreadSafety of CursorPosition from ReadOnly to ReadSafe
- 462 Change ThreadSafety of CursorPosition from to ReadOnly
- 361 Add CursorPosition
FocusLost
| Parameters (2) | |
|---|---|
| enterPressed | bool |
| inputThatCausedFocusLoss | InputObject |
This event fires when the TextBox loses its focus, typically when a
player clicks/taps outside of it or presses Enter. Also fires
if TextBox focus release is forced through
ReleaseFocus().
This event can be used alongside FocusLost to
track when a TextBox both gains and loses focus.
| Thread safety | Unsafe |
|---|
History 4
- 483 Change Parameters of FocusLost from (enterPressed: bool, inputThatCausedFocusLoss: Instance) to (enterPressed: bool, inputThatCausedFocusLoss: InputObject)
- 462 Change ThreadSafety of FocusLost from to Unsafe
- 208 Change Parameters of FocusLost from (enterPressed: bool) to (enterPressed: bool, inputThatCausedFocusLoss: Instance)
- 47 Add FocusLost
Focused
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
This event fires when the TextBox gains focus, typically when a player
clicks/taps on the TextBox to begin text entry. Also fires if TextBox
focus is forced through CaptureFocus().
This event can be used alongside FocusLost to
track when a TextBox both gains and loses focus.
| Thread safety | Unsafe |
|---|
FontFace
| Type | Default | |
|---|---|---|
| Font | ||
This property is similar to the Font property but allows setting fonts that don't exist in Font.
This property is kept in sync with the TextBox.Font property. When
setting FontFace, the Font property is set to the
corresponding enum value, or to Font.Unknown if there are no
matches.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
FontSize
| Type | Default | |
|---|---|---|
| FontSize | Size8 | |
This property determines the font size of a TextBox object.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true/false |
History 6
- 553 Change Default of FontSize from to Size8
- 553 Change PreferredDescriptor of FontSize from to TextSize
- 486 Change ThreadSafety of FontSize from ReadOnly to ReadSafe
- 462 Change ThreadSafety of FontSize from to ReadOnly
- 290 Change Tags of FontSize from [NotReplicated] to [NotReplicated, Deprecated]
- 47 Add FontSize
IsFocused
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| bool | ||
Returns true if the TextBox is focused or false if it is not.
| Thread safety | Unsafe |
|---|
LineHeight
| Type | Default | |
|---|---|---|
| float | 1 | |
Controls the height of lines, as a multiple of the font's em square size,
by scaling the spacing between lines of text in the TextBox. Valid
values range from 1.0 (default) to 3.0.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of LineHeight from to 1
- 486 Change ThreadSafety of LineHeight from ReadOnly to ReadSafe
- 462 Change ThreadSafety of LineHeight from to ReadOnly
- 317 Add LineHeight
MaxVisibleGraphemes
| Type | Default | |
|---|---|---|
| int | -1 | |
This property controls the maximum number of graphemes (or units of text)
that are shown on the TextBox, regardless of whether it's showing the
PlaceholderText or
Text.
Changing the property does not change the position or size of the visible graphemes; the layout will be calculated as if all graphemes are visible.
Setting the property to -1 disables the limit and shows the entirety of
the Text.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 3
- 553 Change Default of MaxVisibleGraphemes from to -1
- 486 Change ThreadSafety of MaxVisibleGraphemes from ReadOnly to ReadSafe
- 469 Add MaxVisibleGraphemes
MultiLine
| Type | Default | |
|---|---|---|
| bool | false | |
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.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
OpenTypeFeatures
| Type | Default | |
|---|---|---|
| string | ||
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 1
- 629 Add OpenTypeFeatures
OpenTypeFeaturesError
| Type | Default | |
|---|---|---|
| string | ||
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | false/true |
History 1
PlaceholderColor3
| Type | Default | |
|---|---|---|
| Color3 | 0.7, 0.7, 0.7 | |
Sets the text color that gets used when no text has been entered into the
TextBox.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 6
- 553 Change Default of PlaceholderColor3 from to Color3(0.7, 0.7, 0.7)
- 486 Change ThreadSafety of PlaceholderColor3 from ReadOnly to ReadSafe
- 462 Change ThreadSafety of PlaceholderColor3 from to ReadOnly
- 310 Change WriteSecurity of PlaceholderColor3 from RobloxScriptSecurity to None
- 310 Change ReadSecurity of PlaceholderColor3 from RobloxScriptSecurity to None
- 294 Add PlaceholderColor3
PlaceholderText
| Type | Default | |
|---|---|---|
| string | ||
Sets the text that gets displayed when no text has been entered into the
TextBox.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 5
- 486 Change ThreadSafety of PlaceholderText from ReadOnly to ReadSafe
- 462 Change ThreadSafety of PlaceholderText from to ReadOnly
- 310 Change WriteSecurity of PlaceholderText from RobloxScriptSecurity to None
- 310 Change ReadSecurity of PlaceholderText from RobloxScriptSecurity to None
- 294 Add PlaceholderText
ReleaseFocus
| Parameters (1) | Default | |
|---|---|---|
| submitted | bool | false |
| Returns (1) | ||
| null | ||
Forces the client to unfocus the TextBox. The submitted parameter lets
you override the enterPressed parameter in the TextBox.FocusLost
event.
| Thread safety | Unsafe |
|---|
History 4
- 573 Change ReturnType of ReleaseFocus from void to null
- 462 Change ThreadSafety of ReleaseFocus from to Unsafe
- 246 Change Parameters of ReleaseFocus from () to (submitted: bool = false)
- 201 Add ReleaseFocus
ResetKeyboardMode
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| null | ||
| Security | RobloxScriptSecurity |
|---|---|
| Thread safety | Unsafe |
History 3
- 573 Change ReturnType of ResetKeyboardMode from void to null
- 462 Change ThreadSafety of ResetKeyboardMode from to Unsafe
- 325 Add ResetKeyboardMode
ReturnPressedFromOnScreenKeyboard
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Thread safety | Unsafe |
|---|
History 2
- 462 Change ThreadSafety of ReturnPressedFromOnScreenKeyboard from to Unsafe
- 405 Add ReturnPressedFromOnScreenKeyboard
RichText
| Type | Default | |
|---|---|---|
| bool | false | |
This property determines whether the TextBox renders the
Text string using
rich text formatting. Rich text uses simple
markup tags to style sections of the string in bold, italics, specific
colors, and more.
Note that when the TextBox has this property enabled and the box gains
focus, the user will be able to edit and interact with the complete XML
string, including all of the formatting tags. When focus is lost, the text
will automatically parse and render the tags as rich text.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
SelectionStart
| Type | Default | |
|---|---|---|
| int | -1 | |
Determines the starting position of a text selection, or -1 if the
TextBox has no range of selected text. This property uses the same
positioning logic as CursorPosition.
SelectionStart will be greater than
CursorPosition if the cursor is at the
beginning of a selection, and less than
CursorPosition if the cursor is at the end.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | false |
History 4
- 553 Change Default of SelectionStart from to -1
- 486 Change ThreadSafety of SelectionStart from ReadOnly to ReadSafe
- 462 Change ThreadSafety of SelectionStart from to ReadOnly
- 391 Add SelectionStart
SetTextFromInput
| Parameters (1) | ||
|---|---|---|
| text | string | |
| Returns (1) | ||
| null | ||
| Security | RobloxScriptSecurity |
|---|---|
| Thread safety | Unsafe |
History 3
- 573 Change ReturnType of SetTextFromInput from void to null
- 462 Change ThreadSafety of SetTextFromInput from to Unsafe
- 268 Add SetTextFromInput
ShowNativeInput
| Type | Default | |
|---|---|---|
| bool | true | |
If set to true, input native to the platform is used instead of Roblox's
built-in keyboard.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
History 4
- 553 Change Default of ShowNativeInput from to true
- 486 Change ThreadSafety of ShowNativeInput from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ShowNativeInput from to ReadOnly
- 272 Add ShowNativeInput
Text
| Type | Default | |
|---|---|---|
| string | TextBox | |
This property determines the text content rendered by the TextBox
element. The visual properties of the string rendered to the screen is
determined by TextColor3,
TextTransparency,
TextSize, FontFace, and
other properties.
It is possible to render emoji such as 👋 and other symbols. These special symbols aren't affected by the TextColor3 property.
This property may contain newline characters, but it is not possible to type newline characters within the Properties window. Similarly, this property may contain a tab character, but it will render as a space instead.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
TextBounds
| Type | Default | |
|---|---|---|
| Vector2 | 0, 0 | |
This read-only property reflects the absolute size of rendered text in offsets. In other words, if you were to try to fit text into a rectangle, this property would reflect the minimum dimensions of the rectangle you would need in order to fit the text.
Using TextService:GetTextSize(), you can predict what TextBounds
will be on a TextLabel given a string, Font,
TextSize and frame size.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | false |
History 4
- 553 Change Default of TextBounds from to Vector2(0, 0)
- 486 Change ThreadSafety of TextBounds from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextBounds from to ReadOnly
- 47 Add TextBounds
TextColor3
| Type | Default | |
|---|---|---|
| Color3 | 0.105882, 0.164706, 0.207843 | |
This property determines the color of non-placeholder text rendered by the
TextBox. Text is rendered after the text stroke.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextColor3 from to Color3(0.105882, 0.164706, 0.207843)
- 486 Change ThreadSafety of TextColor3 from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextColor3 from to ReadOnly
- 47 Add TextColor3
TextDirection
| Type | Default | |
|---|---|---|
| TextDirection | Auto | |
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 1
- 581 Add TextDirection
TextEditable
| Type | Default | |
|---|---|---|
| bool | true | |
This property determines whether the user can change the Text through input. It is recommended to disable ClearTextOnFocus when this property is disabled, otherwise the text can be cleared on-focus.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextEditable from to true
- 486 Change ThreadSafety of TextEditable from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextEditable from to ReadOnly
- 391 Add TextEditable
TextFits
| Type | Default | |
|---|---|---|
| bool | false | |
Whether the text fits within the constraints of the TextBox.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | false |
TextScaled
| Type | Default | |
|---|---|---|
| bool | false | |
This property determines whether text is scaled so that it fills the box's entire space. When enabled, TextSize is ignored and TextWrapped is automatically enabled. When this property is used for on-screen UI, it may be helpful to use a UITextSizeConstraint to restrict the range of possible text sizes.
See TextLabel.TextScaled for additional recommendations when using this property.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextScaled from to false
- 486 Change ThreadSafety of TextScaled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextScaled from to ReadOnly
- 50 Add TextScaled
TextSize
| Type | Default | |
|---|---|---|
| float | 8 | |
This property determines the height in offsets of one line of rendered text. The unit is in offsets, not points as in many document editing programs.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
TextStrokeColor3
| Type | Default | |
|---|---|---|
| Color3 | 0, 0, 0 | |
This property sets the color of the stroke (outline) of the rendered text. This property and TextStrokeTransparency determine the visual appearance of the text stroke.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextStrokeColor3 from to Color3(0, 0, 0)
- 486 Change ThreadSafety of TextStrokeColor3 from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextStrokeColor3 from to ReadOnly
- 48 Add TextStrokeColor3
TextStrokeTransparency
| Type | Default | |
|---|---|---|
| float | 1 | |
This property sets the transparency of the stroke (outline) of the rendered text. This property and TextStrokeColor3 determine the visual appearance of the text stroke.
Since text stroke is simply multiple renderings of the same transparency,
this property is essentially multiplicative on itself four times over; for
example a TextStrokeTransparency of 0.5 appears about the same as
TextTransparency of 0.0625, or 0.5^4.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextStrokeTransparency from to 1
- 486 Change ThreadSafety of TextStrokeTransparency from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextStrokeTransparency from to ReadOnly
- 48 Add TextStrokeTransparency
TextTransparency
| Type | Default | |
|---|---|---|
| float | 0 | |
This property determines the transparency of all the text rendered by the
TextBox.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextTransparency from to 0
- 486 Change ThreadSafety of TextTransparency from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextTransparency from to ReadOnly
- 47 Add TextTransparency
TextTruncate
| Type | Default | |
|---|---|---|
| TextTruncate | None | |
Controls the truncation of the text displayed in the TextBox.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextTruncate from to None
- 486 Change ThreadSafety of TextTruncate from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextTruncate from to ReadOnly
- 326 Add TextTruncate
TextWrap
| Type | Default | |
|---|---|---|
| bool | false | |
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true/false |
History 6
- 553 Change Default of TextWrap from to false
- 553 Change PreferredDescriptor of TextWrap from to TextWrapped
- 486 Change ThreadSafety of TextWrap from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextWrap from to ReadOnly
- 51 Change Tags of TextWrap from [NotReplicated] to [NotReplicated, Deprecated]
- 47 Add TextWrap
TextWrapped
| Type | Default | |
|---|---|---|
| bool | false | |
When enabled, this property will render text on multiple lines within a
TextBox element's space so that TextBounds
will never exceed the GuiBase2d.AbsoluteSize of the element.
This is achieved by breaking long lines of text into multiple lines. Line breaks will prefer whitespace; should a long unbroken word exceed the width of the element, that word will be broken into multiple lines.
If further line breaks would cause the vertical height of the text (the Y component of TextBox.TextBounds) to exceed the vertical height of the element (the Y component of GuiBase2d.AbsoluteSize), then that line will not be rendered at all.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextWrapped from to false
- 486 Change ThreadSafety of TextWrapped from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextWrapped from to ReadOnly
- 51 Add TextWrapped
TextXAlignment
| Type | Default | |
|---|---|---|
| TextXAlignment | Center | |
This property determines the horizontal alignment of text rendered within
the TextBox element's space. It can be used in conjunction with
TextYAlignment to fully determine text
alignment on both axes.
This property does not affect the read-only properties TextBounds and TextFits.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextXAlignment from to Center
- 486 Change ThreadSafety of TextXAlignment from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextXAlignment from to ReadOnly
- 47 Add TextXAlignment
TextYAlignment
| Type | Default | |
|---|---|---|
| TextYAlignment | Center | |
This property determines the vertical alignment of text rendered within
the TextBox element's space. It can be used in conjunction with
TextXAlignment to fully determine text
alignment on both axes.
This property does not affect the read-only properties TextBounds and TextFits.
| Thread safety | ReadSafe |
|---|---|
| Category | Text |
| Loaded/Saved | true |
History 4
- 553 Change Default of TextYAlignment from to Center
- 486 Change ThreadSafety of TextYAlignment from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextYAlignment from to ReadOnly
- 47 Add TextYAlignment
Removed members 3
Content
| Type | Default | |
|---|---|---|
| string | ||
| Thread safety | ReadOnly |
|---|---|
| Category | Text |
| Loaded/Saved | false |
IsPassword
| Type | Default | |
|---|---|---|
| bool | ||
| Security | RobloxScriptSecurity |
|---|---|
| Category | Data |
| Loaded/Saved | true/false |
History 2
- 402 Remove IsPassword
- 380 Add IsPassword