GetTextBoundsParams
Use with TextService:GetTextBoundsAsync() to measure the size of text.
| Memory category | Instances |
|---|
Member index 5
Description
Pass this instance to TextService:GetTextBoundsAsync() to measure the size of text.
History 9
Members 5
Font
| Type | Default | |
|---|---|---|
| Font | ||
The Font of the text being measured. Corresponds to the TextLabel.FontFace property on text objects.
Not to be confused with Font. This is an object that you can create using Font.new().
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
RichText
| Type | Default | |
|---|---|---|
| bool | false | |
Determines whether the text being measured is interpreted using rich text markup. Corresponds to the TextLabel.RichText property on text objects.
By default, the value is false, meaning the
GetTextBoundsParams.Text string is measured verbatim. When set to
true, rich text formatting tags in the string are parsed rather than
measured as literal characters, so the returned bounds reflect the styled
text.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
Size
| Type | Default | |
|---|---|---|
| float | 20 | |
The size of the text that is being measured. Corresponds to the TextLabel.TextSize property.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
Text
| Type | Default | |
|---|---|---|
| string | ||
The text being measured.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |
Width
| Type | Default | |
|---|---|---|
| float | 0 | |
The width of the container for line breaking. By default, the value is 0, which means no line breaking will be performed. You can set it to the width of the container that you'll be putting the text into.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | true |