TextFlag CenterHorizontally

robot_2Generated
code_blocksInput

Description

The CenterHorizontally field is a member of the TextFlag enumeration in the Sandbox namespace. It is used to align text or other elements in the center along the X axis. This flag can be combined with other TextFlag values to achieve the desired alignment and positioning of text within a graphical interface.

Usage

To use the CenterHorizontally flag, combine it with other TextFlag values to specify the alignment of text. For example, you can combine it with Top to center text horizontally while anchoring it to the top of the container.

Example

// Example of using TextFlag.CenterHorizontally
Graphics.DrawText("Hello, World!", new Vector2(100, 50), TextFlag.CenterHorizontally | TextFlag.Top);