Menu
Lumberyard
Developer Guide (Version 1.12)

UITextComponent

Controls the text and formatting of a text element.

UiTextBus

Services messages for the UiTextComponent.

GetColor

Returns the color to draw the text string.

Syntax

Copy
AZ::Color GetColor()

GetFont

Returns the pathname to the font.

Syntax

Copy
AZStd::string GetFont()

GetFontEffect

Returns the font effect.

Syntax

Copy
int GetFontEffect()

GetFontSize

Returns the size of the font in points.

Syntax

Copy
float GetFontSize()

GetHorizontalTextAlignment

Returns the horizontal text alignment.

Syntax

Copy
eUiHAlign GetHorizontalTextAlignment()

Following are possible values for eUiHAlign.

Copy
enum eUiHAlign { eUiHAlign_Left, eUiHAlign_Center, eUiHAlign_Right };

GetOverflowMode

Returns the overflow behavior of the text.

Syntax

Copy
eUiTextOverflowMode GetOverflowMode()

Following are possible values for eUiTextOverflowMode.

Copy
enum eUiTextOverflowMode { eUiTextOverflowMode_OverflowText, eUiTextOverflowMode_ClipText };

GetText

Returns the text string being displayed by the element.

Syntax

Copy
AZStd::string GetText()

GetVerticalTextAlignment

Returns the vertical text alignment.

Syntax

Copy
eUiVAlign GetVerticalTextAlignment()

Following are possible values for eUiVAlign.

Copy
enum eUiVAlign { eUiVAlign_Top, eUiVAlign_Center, eUiVAlign_Bottom };

GetWrapText

Returns whether text is wrapped.

Syntax

Copy
eUiTextWrapTextSetting GetWrapText()

Following are possible values for eUiTextWrapTextSetting.

Copy
enum eUiTextWrapTextSetting { eUiTextWrapTextSetting_NoWrap, eUiTextWrapTextSetting_Wrap };

SetColor

Sets the color to draw the text string.

Syntax

Copy
void SetColor(const AZ::Color& color)

SetFont

Sets the pathname to the font.

Syntax

Copy
void SetFont(const AZStd::string& fontPath)

SetFontEffect

Sets the font effect.

Syntax

Copy
void SetFontEffect(int effectIndex)

SetFontSize

Sets the size of the font in points.

Syntax

Copy
void SetFontSize(float size)

SetHorizontalTextAlignment

Sets the horizontal text alignment.

Syntax

Copy
void SetHorizontalTextAlignment(eUiHAlign alignment)

For possible values for eUiHAlign, see GetHorizontalTextAlignment.

SetOverflowMode

Sets the overflow behavior of the text.

Syntax

Copy
void SetOverflowMode(eUiTextOverflowMode overflowMode)

For possible values for eUiTextOverflowMode, see GetOverflowMode.

SetText

Sets the text string being displayed by the element.

Syntax

Copy
void SetText(const AZStd::string& text)

SetVerticalTextAlignment

Sets the vertical text alignment.

Syntax

Copy
void SetVerticalTextAlignment(eUiVAlign alignment)

For possible values for eUiVAlign, see GetVerticalTextAlignment.

SetWrapText

Sets whether text is wrapped.

Syntax

Copy
void SetWrapText(eUiTextWrapTextSetting wrapSetting)

For possible values for eUiTextWrapTextSetting, see GetWrapText.

On this page: