UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TextRenderComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4#pragma once
5
6#include "CoreMinimal.h"
10#include "TextRenderComponent.generated.h"
11
13class UFont;
15
16UENUM()
18{
20 EHTA_Left UMETA(DisplayName="Left"),
22 EHTA_Center UMETA(DisplayName="Center"),
24 EHTA_Right UMETA(DisplayName="Right"),
25};
26
27UENUM()
29{
31 EVRTA_TextTop UMETA(DisplayName="Text Top"),
33 EVRTA_TextCenter UMETA(DisplayName="Text Center"),
35 EVRTA_TextBottom UMETA(DisplayName="Text Bottom"),
37 EVRTA_QuadTop UMETA(DisplayName="Quad Top"),
38};
39
43UCLASS(Blueprintable, ClassGroup=Rendering, hidecategories=(Object,LOD,Physics,TextureStreaming,Activation,"Components|Activation",Collision), editinlinenew, meta=(BlueprintSpawnableComponent), MinimalAPI)
44class UTextRenderComponent : public UPrimitiveComponent
45{
47
48
49 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text, meta=(MultiLine=true))
50 FText Text;
51
53 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text)
54 TObjectPtr<class UMaterialInterface> TextMaterial;
55
57 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text)
58 TObjectPtr<class UFont> Font;
59
61 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text, meta=(DisplayName = "Horizontal Alignment"))
62 TEnumAsByte<enum EHorizTextAligment> HorizontalAlignment;
63
65 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text, meta=(DisplayName = "Vertical Alignment"))
66 TEnumAsByte<enum EVerticalTextAligment> VerticalAlignment;
67
69 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text)
70 FColor TextRenderColor;
71
73 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text)
74 float XScale;
75
77 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text)
78 float YScale;
79
81 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Text)
82 float WorldSize;
83
85 UPROPERTY()
86 float InvDefaultSize;
87
89 UPROPERTY(EditAnywhere, BlueprintReadOnly, AdvancedDisplay, Category=Text)
90 float HorizSpacingAdjust;
91
93 UPROPERTY(EditAnywhere, BlueprintReadOnly, AdvancedDisplay, Category=Text)
94 float VertSpacingAdjust;
95
97 UPROPERTY(EditAnywhere, BlueprintReadOnly, AdvancedDisplay, Category=Rendering)
98 uint32 bAlwaysRenderAsText:1;
99
100 // -----------------------------
101
103 UFUNCTION()
104 ENGINE_API void SetText(const FText& Value);
105
107 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender", meta=(DisplayName="Set Text", ScriptName="SetText"))
108 ENGINE_API void K2_SetText(const FText& Value);
109
111 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
113
115 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
116 ENGINE_API void SetFont(UFont* Value);
117
119 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
120 ENGINE_API void SetHorizontalAlignment(EHorizTextAligment Value);
121
123 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
124 ENGINE_API void SetVerticalAlignment(EVerticalTextAligment Value);
125
127 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
129
131 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
132 ENGINE_API void SetXScale(float Value);
133
135 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
136 ENGINE_API void SetYScale(float Value);
137
139 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
141
143 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
145
147 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
148 ENGINE_API void SetWorldSize(float Value);
149
151 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
153
155 UFUNCTION(BlueprintCallable, Category="Rendering|Components|TextRender")
157
158 // -----------------------------
159
160 //~ Begin UPrimitiveComponent Interface.
163 ENGINE_API virtual int32 GetNumMaterials() const override;
164 ENGINE_API virtual UMaterialInterface* GetMaterial(int32 ElementIndex) const override;
165 ENGINE_API virtual bool ShouldRecreateProxyOnUpdateTransform() const override;
166 ENGINE_API virtual void SetMaterial(int32 ElementIndex, UMaterialInterface* InMaterial) override;
167 ENGINE_API virtual FMatrix GetRenderMatrix() const override;
168 //~ End UPrimitiveComponent Interface.
169
170 //~ Begin USceneComponent Interface.
171#if WITH_EDITOR
172 ENGINE_API virtual bool GetMaterialPropertyPath(int32 ElementIndex, UObject*& OutOwner, FString& OutPropertyPath, FProperty*& OutProperty) override;
173#endif // WITH_EDITOR
174 ENGINE_API virtual FBoxSphereBounds CalcBounds(const FTransform& LocalToWorld) const override;
175 // Note: this is required because GetRenderMatrix is overridden, and therefore the updated world-space bounds must be based on that (not the component transform)
176 ENGINE_API virtual void UpdateBounds() override;
177 //~ End USceneComponent Interface.
178
179 //~ Begin UActorComponent Interface.
180 ENGINE_API virtual bool RequiresGameThreadEndOfFrameUpdates() const override;
181 ENGINE_API virtual void PrecachePSOs() override;
182 //~ End UActorComponent Interface.
183
184 //~ Begin UObject Interface.
185 ENGINE_API virtual void PostLoad() override;
186 //~ End UObject interface.
187
188 static ENGINE_API void InitializeMIDCache();
189 static ENGINE_API void ShutdownMIDCache();
190};
191
192
193
194
195
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
EVerticalTextAligment
Definition TextRenderComponent.h:29
@ UMETA
Definition TextRenderComponent.h:20
EHorizTextAligment
Definition TextRenderComponent.h:18
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition PrimitiveSceneProxy.h:296
Definition UnrealType.h:174
Definition Text.h:385
Definition Array.h:670
Definition EnumAsByte.h:22
Definition Font.h:111
Definition MaterialInterface.h:296
Definition Object.h:95
ENGINE_API FBox CalcBounds(const FVector &P0, const FVector &P1, const FVector &P2, const FVector &P3)
Definition BezierUtilities.cpp:26
@ false
Definition radaudio_common.h:23
Definition Color.h:486
Definition ObjectPtr.h:488
Definition BoxSphereBounds.h:25