|
Interface Manager
C4Interface.h
class TextElementTheTextElement class represents an interface element that displays a text string.
Definition
Member Functions
Constructor
Parameters
Description
The TextElement class handles all text rendering in the C4 Engine. A text element displays a text string of arbitrary length using a single font. Text can be rendered on a single line, or it can be rendered on multiple lines in a text box. There are also several formatting tags that can be embedded in the text to control color, underlining, and alignment.If the text parameter is not nullptr, then the string that it points to is copied into the text element. If the font parameter is not nullptr, then the font object's reference count is incremented, and the font is released when the text element is destroyed.By default, a text element renders text on a single line. A text element can be changed to a text box configuration by calling the TextElement::SetTextFlags function to set the kTextWrapped flag and calling the TextElement::SetElementSize function to set the size of the text box.The text stored in a text element may contain embedded formatting tags. A formatting tag is composed of four characters enclosed in square brackets. Formatting can be disabled altogether by setting the kTextUnformatted flag with the TextElement::SetTextFlags function, and specific types of formatting can be masked off using the TextElement::SetTextFormatExclusionMask function. (By default, alignment formatting is masked.) The following table lists the formatting tags recognized by the text element class.
Base Classes
|