UTextRenderComponent

Renders text in the world with given font.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/TextRenderComponent.h

Include

#include "Components/TextRenderComponent.h"

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 Const

FVector

 

GetTextLocalSize()

Get local size of text

Public function Const

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 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 Const

UMaterialInt...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual Const

int32

 

GetNumMaterials()

Return number of material elements in this primitive

Public function Virtual Const

FMatrix

 

GetRenderMatrix()

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

Public function Virtual Const

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 Const

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 Const

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()

Do any object-specific cleanup required immediately after loading an object.

Deprecated Functions

Name Description

Public function

void

 

SetText

(
    const FString& Value
)

Passing text as FString is deprecated, please use FText instead (likely via a LOCTEXT).

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback