Navigation
API > API/Runtime > API/Runtime/Engine
Renders text in the world with given font. Contains usual font related attributes such as Scale, Alignment, Color etc.
| Name | UTextRenderComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/TextRenderComponent.h |
| Include Path | #include "Components/TextRenderComponent.h" |
Syntax
UCLASS (Blueprintable, ClassGroup=Rendering,
HideCategories=(Object, LOD, Physics, TextureStreaming, Activation, "Components|Activation", Collision),
EditInlineNew, Meta=(BlueprintSpawnableComponent), MinimalAPI)
class UTextRenderComponent : public UPrimitiveComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UPrimitiveComponent → UTextRenderComponent
Implements Interfaces
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IInterface_AsyncCompilation
- INavRelevantInterface
- IPhysicsComponent
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UTextRenderComponent
(
const FObjectInitializer& ObjectInitializer |
Components/TextRenderComponent.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAlwaysRenderAsText | uint32 | Allows text to draw unmodified when using debug visualization modes. | Components/TextRenderComponent.h |
|
| Font | TObjectPtr< class UFont > | Text font | Components/TextRenderComponent.h |
|
| HorizontalAlignment | TEnumAsByte< enum EHorizTextAligment > | Horizontal text alignment | Components/TextRenderComponent.h |
|
| HorizSpacingAdjust | float | Horizontal adjustment per character, default is 0.0 | Components/TextRenderComponent.h |
|
| InvDefaultSize | float | The inverse of the Font's character height. | Components/TextRenderComponent.h | |
| Text | FText | Text content, can be multi line using | ||
| as line separator | Components/TextRenderComponent.h |
|
||
| TextMaterial | TObjectPtr< class UMaterialInterface > | Text material | Components/TextRenderComponent.h |
|
| TextRenderColor | FColor | Color of the text, can be accessed as vertex color | Components/TextRenderComponent.h |
|
| VerticalAlignment | TEnumAsByte< enum EVerticalTextAligment > | Vertical text alignment | Components/TextRenderComponent.h |
|
| VertSpacingAdjust | float | Vertical adjustment per character, default is 0.0 | Components/TextRenderComponent.h |
|
| WorldSize | float | Vertical size of the fonts largest character in world units. | Components/TextRenderComponent.h |
|
| XScale | float | Horizontal scale, default is 1.0 | Components/TextRenderComponent.h |
|
| YScale | float | Vertical scale, default is 1.0 | Components/TextRenderComponent.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FVector GetTextLocalSize() |
Get local size of text | Components/TextRenderComponent.h |
|
FVector GetTextWorldSize() |
Get world space size of text | Components/TextRenderComponent.h |
|
void K2_SetText
(
const FText& Value |
Change the text value and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetFont
(
UFont* Value |
Change the font and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetHorizontalAlignment
(
EHorizTextAligment Value |
Change the horizontal alignment and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetHorizSpacingAdjust
(
float Value |
Change the text horizontal spacing adjustment and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetText
(
const FText& Value |
Change the text value and signal the primitives to be rebuilt | Components/TextRenderComponent.h | |
void SetTextMaterial
(
UMaterialInterface* Material |
Change the text material and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetTextRenderColor
(
FColor Value |
Change the text render color and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetVerticalAlignment
(
EVerticalTextAligment Value |
Change the vertical alignment and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetVertSpacingAdjust
(
float Value |
Change the text vertical spacing adjustment and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetWorldSize
(
float Value |
Change the world size of the text and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetXScale
(
float Value |
Change the text X scale and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
void SetYScale
(
float Value |
Change the text Y scale and signal the primitives to be rebuilt | Components/TextRenderComponent.h |
|
Overridden from UPrimitiveComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FPrimitiveSceneProxy * CreateSceneProxy() |
Creates a proxy to represent the primitive to the scene manager in the rendering thread. | Components/TextRenderComponent.h | |
virtual UMaterialInterface * GetMaterial
(
int32 ElementIndex |
Returns the material used by the element at the specified index | Components/TextRenderComponent.h | |
virtual int32 GetNumMaterials() |
Return number of material elements in this primitive | Components/TextRenderComponent.h | |
virtual FMatrix GetRenderMatrix () |
Returns the matrix that should be used to render this component. | Components/TextRenderComponent.h | |
virtual void GetUsedMaterials
(
TArray< UMaterialInterface* >& OutMaterials, |
Retrieves the materials used in this component | Components/TextRenderComponent.h | |
virtual void SetMaterial
(
int32 ElementIndex, |
Changes the material applied to an element of the mesh. | Components/TextRenderComponent.h | |
virtual bool ShouldRecreateProxyOnUpdateTransform() |
Determines whether the proxy for this primitive type needs to be recreated whenever the primitive moves. | Components/TextRenderComponent.h |
Overridden from USceneComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FBoxSphereBounds CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. | Components/TextRenderComponent.h | |
| Returns full material property path and UObject owner property object Path examples: Material property path with array element and inner struct Materials[0].InnerStruct.Material Material property path with array element Materials[0] Simple material property path Materials | Components/TextRenderComponent.h | ||
virtual void UpdateBounds() |
Note: this is required because GetRenderMatrix is overridden, and therefore the updated world-space bounds must be based on that (not the component transform) | Components/TextRenderComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PrecachePSOs() |
Precache all PSOs which can be used by the primitive component | Components/TextRenderComponent.h | |
virtual bool RequiresGameThreadEndOfFrameUpdates() |
Return true if this component requires end of frame updates to happen from the game thread. | Components/TextRenderComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostLoad() |
Components/TextRenderComponent.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void InitializeMIDCache() |
Components/TextRenderComponent.h | ||
static void ShutdownMIDCache() |
Components/TextRenderComponent.h |