Collapse Sidebar




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 TextBox/TextXAlignment to fully determine text alignment on both axes. This property won’t affect the read-only properties TextBox/TextBounds and TextBox/TextFits.

Code Samples

Text Alignment

This code sample shows all the different text alignment combinations by iterating over each enum item. It is meant to be placed within a TextLabel, TextButton or TextBox.