This property provides a copy of TextButton.Text that contains
exactly what is being rendered by the TextButton. This is useful
for eliminating style tags used for rich text.
Example
When TextButton.RichText is enabled, the
TextButton.ContentText property shows the text as it appears to
the player.
RichText | Text | ContentText |
---|
false | <b>Hello,<br/> world!</b> | <b>Hello,<br/> world!</b> |
true | <b>Hello,<br/> world!</b> | Hello, world! |
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
History 2
Tags: [ReadOnly, NotReplicated]
The Font property selects one of several pre-defined fonts with which the
UI element will render its text. Some fonts have bold, italic and/or light
variants (as there is no font-weight or font-style properties).
With the exception of the "Legacy" font, each font will render text with
the line height equal to the TextButton.TextSize property. The
"Code" font is the only monospace font. It has the unique property that
each character has the exact same width and height ratio of 1:2. The width
of each character is approximately half the TextButton.TextSize
property.
This property is kept in sync with the TextButton.FontFace
property. When setting Font, the FontFace is set to
Font.fromEnum(value).
Its interface does not cross the network boundary.
It is not meant to be used, and may have unresolved issues.
History 7
- 558
Change Tags of Font
from
[Hidden]
to
[Hidden, NotReplicated]
- 558
Change CanSave of Font
from
true
to
false
- 553
Change Default of Font
from
to
Legacy
- 549
Change Tags of Font
from
[]
to
[Hidden]
- 486
Change ThreadSafety of Font
from
ReadOnly
to
ReadSafe
- 462
Change ThreadSafety of Font
from
to
ReadOnly
- 47
Add Font
Tags: [Hidden, NotReplicated]
LocalizationMatchedSourceText
Its interface does not cross the network boundary.
It is not meant to be used, and may have unresolved issues.
History 4
Tags: [Hidden, NotReplicated]
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
It is not meant to be used, and may have unresolved issues.
History 3
Tags: [Hidden, ReadOnly, NotReplicated]
This property determines whether the TextButton renders the
TextButton.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.
To use rich text, simply include formatting tags in the
TextButton.Text string.
History 4
The Text property determines the content rendered by the UI element. The
visual properties of the string rendered to the screen is determined by
TextButton.TextColor3, TextButton.TextTransparency,
TextButton.TextSize, TextButton.Font,
TextButton.TextScaled, TextButton.TextWrapped,
TextButton.TextXAlignment and TextButton.TextYAlignment.
It is possible to render emoji (for example, 😃) and other symbols. These
special symbols aren't affected by the TextButton.TextColor3
property. These can be pasted into Script and LocalScript
objects, as well as the field within the Properties window.
This property may contain newline characters, however, 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.
History 4
- 553
Change Default of Text
from
to
Button
- 486
Change ThreadSafety of Text
from
ReadOnly
to
ReadSafe
- 462
Change ThreadSafety of Text
from
to
ReadOnly
- 47
Add Text
The read-only property TextBounds 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, TextButton.Font,
TextButton.TextSize and frame size.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
History 4
Tags: [ReadOnly, NotReplicated]
This property determines the color of text.
It exists only for backward compatibility, and should not be used for new work.
Its interface does not cross the network boundary.
It is not meant to be used, and may have unresolved issues.
History 4
Tags: [Hidden, NotReplicated, Deprecated]
Type | Default |
---|
Color3 | 0.105882, 0.164706, 0.207843 |
History 4
A boolean representation of whether the TextButton's text fits within the
size of it.
Its interface does not cross the network boundary.
Its value can be read, but it cannot be modified.
History 4
Tags: [ReadOnly, NotReplicated]
Rather than using TextScaled, we recommend you consider using
AutomaticSize, a new method to dynamically
size UI that will give you the best visual result possible.
The TextScaled property determines whether text is scaled so that it fills
the entire UI element's space. When this is enabled,
TextButton.TextSize is ignored and TextButton.TextWrapped
is automatically enabled. This property is useful for text-rendering UI
elements within BillboardGuis.
When this property is used for screen-space UI, it may be desirable to use
a UITextSizeConstraint to restrict the range of possible text
sizes.
TextScaled and AutomaticSize
It's recommended that developers avoid usage of TextScaled and adjust UI
to take advantage of the AutomaticSize property instead. Here are the core
differences between the two properties:
- TextScaled scales the content (text) to accommodate the UI. Without
careful consideration, some text may become unreadable if scaled too
small.
- AutomaticSize resizes the UI to accommodate content.
With AutomaticSize, you're able to adjust your UI to accommodate the
content (text) while maintaining a consistent font size. For more
information on how to use automatic sizing, see the UI Automatic Size
article.
We suggest that you don't apply both TextScaled and AutomaticSize on the
same UI object. If you apply both properties:
- AutomaticSize determines the maximum amount of available space that a
GuiObject can use (in this case, text)
- TextScaled uses the available space determined by AutomaticSize, to
scale the font size to fit the available space, which will expand up to
the maximum font size (100), if there are no size constraints
- The end result will be: text goes to 100 font size and the UI object
will expand to fit that text
Using both AutomaticSize and TextScaled at the same time can result in
significant scaling differences than when AutomaticSize is off.
History 4
The TextSize property determines the height in offsets of one line of
rendered text. The unit is in offsets, not points (which is used in most
document editing programs). The "Legacy" font does not hold this property.
History 4
The TextStrokeColor3 property sets the color of the stroke, or outline, of
rendered text. This property and TextButton.TextStrokeTransparency
determine the visual properties of the text stroke.
Text stroke is rendered before normal text and is simply 4 renderings of
the same text in +/- 1 pixel offsets in each direction. Text stroke
rendering works independently and identically to
TextButton.TextColor3 and TextButton.TextTransparency.
History 4
The TextStrokeTransparency property sets the transparency of the stroke,
or outline, of rendered text. This property and
TextButton.TextStrokeColor3 determine the visual properties of the
text stroke.
Text stroke is rendered before normal text and is simply 4 renderings of
the same text in +/- 1 pixel offsets in each direction. Text stroke
rendering works independently and identically to
TextButton.TextColor3 and TextButton.TextTransparency.
Since text stroke is simply multiple renderings of the same transparency,
this property is essentially multiplicative on itself four times over
(e.g. a TextStrokeTransparency of 0.5 appears about the same as
TextTransparency of 0.0625, or 0.5^4). Therefore, it's recommended to set
TextStrokeTransparency to a value in the range of 0.75 to 1 for more a
more subtle effect.
History 4
The TextColor3 property determines the transparency of all the text
rendered by a UI element. This property along with
TextButton.Font, TextButton.TextSize and
TextButton.TextColor3 will determine the visual properties of
text. Text is rendered after the text stroke
(TextButton.TextStrokeTransparency).
Fading text in using a numeric for-loop is a fantastic way to draw a
player's attention to text appearing on screen.
-- Count backwards from 1 to 0, decrementing by 0.1
for i = 1, 0, -0.1 do
textLabel.TextTransparency = i
task.wait(0.1)
end
History 4
Controls the truncation of the text displayed in this TextButton.
History 4
This property determines whether or not text should wrap at the edges of
the object.
It exists only for backward compatibility, and should not be used for new work.
TextWrapped should be used instead.
Its interface does not cross the network boundary.
History 6
Tags: [NotReplicated, Deprecated]
When enabled, this property will render text on multiple lines within a
GUI element's space so that
TextButton.TextBounds will never exceed the
GuiBase2d.AbsoluteSize of the UI 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 TextButton.TextBounds) to exceed the vertical height
of the element (the Y component of GuiBase2d.AbsoluteSize), then
that line will not be rendered at all.
History 4
TextXAlignment determines the horizontal alignment (X-axis) of text
rendered within a UI element's space. It functions similarly to the CSS
text-align property, with left, right and center values (there is no
justify option). For Left and Right, text is rendered such that the
left/right text bounds just touch the edge of the UI element rectangle.
For Center, each line of text is centered on the very center of the UI
element rectangle.
This property is used in conjunction with
TextButton.TextYAlignment to fully determine text alignment on
both axes. This property won't affect the read-only properties
TextButton.TextBounds and TextButton.TextFits.
History 4
TextYAlignment determines the vertical alignment (Y-axis) of text rendered
within a UI element's space. For Top and Bottom, text is rendered such
that the top/bottom text bounds just touch the edge of the UI element
rectangle. For Center, text is rendered such that there is an equal space
from the top bounds of the text to the top of the element and the bottom
bounds of the text to the bottom of the element.
This property is used in conjunction with
TextButton.TextXAlignment to fully determine text alignment on
both axes. This property won't affect the read-only properties
TextButton.TextBounds and TextButton.TextFits.
History 4