UTextRenderComponent

Inheritance Hierarchy

Syntax

class UTextRenderComponent : public UPrimitiveComponent

Remarks

Renders text in the world with given font. Contains usual font related attributes such as Scale, Alignment, Color etc.

Variables

Name Description

Public variable

uint32 : 1

 

bAlwaysRenderAsText

Allows text to draw unmodified when using debug visualization modes.

Public variable

UFont *

 

Font

Text font

Public variable

TEnumAsByte < en...

 

HorizontalAlignment

Horizontal text alignment

Public variable

float

 

HorizSpacingAdjust

Horizontal adjustment per character, default is 0.0

Public variable

float

 

InvDefaultSize

The inverse of the Font's character height.

Public variable

FText

 

Text

Text content, can be multi line using as line separator

Public variable

UMaterialInterf ...

 

TextMaterial

Text material

Public variable

FColor

 

TextRenderColor

Color of the text, can be accessed as vertex color

Public variable

TEnumAsByte < en...

 

VerticalAlignment

Vertical text alignment

Public variable

float

 

VertSpacingAdjust

Vertical adjustment per character, default is 0.0

Public variable

float

 

WorldSize

Vertical size of the fonts largest character in world units.

Public variable

float

 

XScale

Horizontal scale, default is 1.0

Public variable

float

 

YScale

Vertical scale, default is 1.0

Constructors

Name Description

Public function

UTextRenderComponent

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function

FVector

 

GetTextLocalSize()

Get local size of text

Public function

FVector

 

GetTextWorldSize()

Get world space size of text

Public function Static

void

 

InitializeMIDCache()

Public function

void

 

K2_SetText

(
    const FText & Value
)

Change the text value and signal the primitives to be rebuilt

Public function

void

 

SetFont

(
    UFont * Value
)

Change the font and signal the primitives to be rebuilt

Public function

void

 

SetHorizontalAlignment

(
    EHorizTextAligment Value
)

Change the horizontal alignment and signal the primitives to be rebuilt

Public function

void

 

SetHorizSpacingAdjust

(
    float Value
)

Change the text horizontal spacing adjustment and signal the primitives to be rebuilt

Public function

void

 

SetText

(
    const FString & Value
)

Change the text value and signal the primitives to be rebuilt The FString variant is deprecated in favor of the FText variant

Public function

void

 

SetText

(
    const FText & Value
)

Change the text value and signal the primitives to be rebuilt

Public function

void

 

SetTextMaterial

(
    UMaterialInterface * Material
)

Change the text material and signal the primitives to be rebuilt

Public function

void

 

SetTextRenderColor

(
    FColor Value
)

Change the text render color and signal the primitives to be rebuilt

Public function

void

 

SetVerticalAlignment

(
    EVerticalTextAligment Value
)

Change the vertical alignment and signal the primitives to be rebuilt

Public function

void

 

SetVertSpacingAdjust

(
    float Value
)

Change the text vertical spacing adjustment and signal the primitives to be rebuilt

Public function

void

 

SetWorldSize

(
    float Value
)

Change the world size of the text and signal the primitives to be rebuilt

Public function

void

 

SetXScale

(
    float Value
)

Change the text X scale and signal the primitives to be rebuilt

Public function

void

 

SetYScale

(
    float Value
)

Change the text Y scale and signal the primitives to be rebuilt

Public function Static

void

 

ShutdownMIDCache()

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

FPrimitiveSc ...

 

CreateSceneProxy()

Creates a proxy to represent the primitive to the scene manager in the rendering thread.

Public function Virtual

UMaterialInt ...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual

int32

 

GetNumMaterials()

Number of material elements in this primitive

Public function Virtual

FMatrix

 

GetRenderMatrix()

Returns the matrix that should be used to render this component.

Public function Virtual

void

 

GetUsedMaterials

(
    TArray < UMaterialInterface * > ...,
    bool bGetDebugMaterials
)

Retrieves the materials used in this component

Public function Virtual

void

 

SetMaterial

(
    int32 ElementIndex,
    UMaterialInterface * Material
)

Changes the material applied to an element of the mesh.

Public function Virtual

bool

 

ShouldRecreateProxyOnUpdateTransform()

Determines whether the proxy for this primitive type needs to be recreated whenever the primitive moves.

Overridden from USceneComponent

Name Description

Public function Virtual

FBoxSphereBo ...

 

CalcBounds

(
    const FTransform & LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostLoad()

WITH_EDITOR.

References

Module

Engine

Header

Runtime/Engine/Classes/Components/TextRenderComponent.h