TextFlag Center

book_4_sparkGenerated
code_blocksInput

Description

The Center field of the TextFlag enumeration is used to align text or other elements in the center on both the X and Y axes. This flag is part of the Sandbox.TextFlag enum, which provides various options for positioning text within a given area.

Usage

Use the TextFlag.Center flag when you want to center text both horizontally and vertically within its bounding box. This is particularly useful in UI design where centered alignment is required for aesthetic or functional purposes.

Example

// Example of using TextFlag.Center in a drawing context
Graphics.DrawText("Centered Text", position, font, color, TextFlag.Center);