ue 4 支持的中文字体与对应的材质//字体
UFont* TextFont = nullptr;
{
static ConstructorHelpers::FObjectFinder ObjectFinder(TEXT("Font'/Game/Fonts/Font_MicrosoftYahei.Font_MicrosoftYahei'"));
TextFont = ObjectFinder.Object;
check(TextFont != nullptr);
}
//字体材质
UMaterialInterface* TextMaterial = nullptr;
{
static ConstructorHelpers::FObjectFinder ObjectFinder(TEXT("Material'/Game/Fonts/Mat_Font_MicrosoftYahei.Mat_Font_MicrosoftYahei'"));
TextMaterial = ObjectFinder.Object;
check(TextMaterial != nullptr);
}
最后在把字体与材质应用到文本渲染组件
2022-01-12 11:08:39
2.12MB
ue
4
中文字体
1