TextFlag CenterTop

book_4_sparkGenerated
code_blocksInput

Description

The CenterTop field is a member of the TextFlag enumeration in the Sandbox namespace. It is used to specify the alignment of text or other elements such that they are anchored to the top side and centered horizontally. This flag is part of a set of flags that dictate the positioning of text within a given area.

Usage

Use the CenterTop flag when you want to align text or elements to the top of a container while keeping them centered horizontally. This can be particularly useful in UI design where consistent alignment is necessary across different components.

Example

// Example of using TextFlag.CenterTop in a drawing context
Graphics.DrawText("Hello, World!", new Vector2(100, 50), TextFlag.CenterTop);