TextFlag WrapAnywhere

book_4_sparkGenerated
code_blocksInput

Description

The WrapAnywhere field is a member of the TextFlag enumeration in the Sandbox namespace. It is used to specify that text can be wrapped at any character, rather than only at word boundaries. This can be useful in scenarios where space is limited and word wrapping might not be sufficient to fit text within a given area.

Usage

Use TextFlag.WrapAnywhere when you need to ensure that text fits within a constrained space by allowing it to wrap at any character. This flag can be combined with other TextFlag values to achieve the desired text alignment and wrapping behavior.

Example

// Example of using TextFlag.WrapAnywhere
Graphics.DrawText("This is a long text that needs to wrap anywhere.", new Vector2(100, 100), TextFlag.WrapAnywhere);