Description
The Justify
field is a member of the TextFlag
enumeration in the Sandbox namespace. It is used to specify text alignment options, particularly for justifying text within a given space. This flag is part of a set of flags that dictate the positioning of text and other elements, allowing for flexible layout configurations.
Usage
Use the TextFlag.Justify
flag when you want to align text such that it is evenly distributed across the line, with both the left and right edges aligned. This is typically used in scenarios where text needs to fill the entire width of a container, creating a clean and professional appearance.
Combine TextFlag.Justify
with other TextFlag
values to achieve the desired text alignment and positioning. Be cautious of combining conflicting flags, as this can lead to undefined behavior.
Example
// Example of using TextFlag.Justify in a text drawing context
Graphics.DrawText("This is a justified text example.", new Vector2(100, 100), TextFlag.Justify | TextFlag.Top);