Collapse Sidebar




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, TextBox/Font, TextBox/TextSize and frame size.

Code Samples

Dynamic TextBox Size

This code sample dynamically resizes a TextLabel, TextButton or TextBox to match the size of its TextBounds. Try changing the minimum width/height and pasting into a LocalScript in a TextBox.