TextFlag SingleLine

book_4_sparkGenerated
code_blocksInput

Description

The SingleLine field is a member of the TextFlag enumeration in the Sandbox namespace. It is used to limit the text to a single line when rendering text using methods like Graphics.DrawText and Graphics.MeasureText. This flag ensures that the text does not wrap to a new line, regardless of the available space.

Usage

To use the SingleLine flag, combine it with other TextFlag values to control text rendering behavior. For example, you can use it to ensure that text is rendered on a single line while also aligning it to the left or center.

Example

// Example of using the SingleLine flag with Graphics.DrawText
Graphics.DrawText("This is a single line of text", new Vector2(100, 100), Color.White, TextFlag.SingleLine | TextFlag.Left);