UITextSizeConstraint
Ensures that the size of text rendered by certain GuiObject classes lies within the range described by MaxTextSize and MinTextSize.
Memory category | Instances |
---|
Member index 2
Description
A UITextSizeConstraint ensures that the size of text rendered by certain GuiObject classes (TextLabel, TextButton, or TextBox) lies within the range described by MaxTextSize and MinTextSize. It is meant to be used alongside TextLabel.TextScaled, which automatically scales text to fill its containing object. Like other UI constraints, it is applied when parented to the object to be constrained.
It's recommended that no values lower than 9 be used for MinTextSize property, otherwise text may not be readable to most users.
History 9
- 553 Change Default of MinTextSize from to 1
- 553 Change Default of MaxTextSize from to 100
- 486 Change ThreadSafety of MinTextSize from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxTextSize from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MinTextSize from to ReadOnly
- 462 Change ThreadSafety of MaxTextSize from to ReadOnly
- 266 Add MinTextSize
- 266 Add MaxTextSize
- 266 Add UITextSizeConstraint
Members 2
MaxTextSize
Type | Default | |
---|---|---|
int | 100 |
This property indicates the largest size in pixels the font is allowed to be. It defaults to 1000 pixels and much be set larger than or equal to the MinTextSize property.
If the affected GuiObject has its TextScaled property set to true the text size constrained by this property will scale dynamically with the container's size. It will scale upwards with the GuiObject's size until the max size is reached, at which point it will stay constant if the UI element continues to grow.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 4
- 553 Change Default of MaxTextSize from to 100
- 486 Change ThreadSafety of MaxTextSize from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MaxTextSize from to ReadOnly
- 266 Add MaxTextSize
MinTextSize
Type | Default | |
---|---|---|
int | 1 |
This property indicated the smallest size in pixels the font is allowed to be. This value defaults to 1 pixel and must be set less than or equal to UITextSizeConstraint.MaxTextSize.
If the affected GuiObject has its TextScaled property set to true the text size constrained by this property will scale dynamically with the container's size. It will scale downwards with the GuiObject's size until the min size is reached, at which point it will stay constant if the UI element continues to shrink.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 4
- 553 Change Default of MinTextSize from to 1
- 486 Change ThreadSafety of MinTextSize from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MinTextSize from to ReadOnly
- 266 Add MinTextSize