上传者: wenshuifuping
|
上传时间: 2022-01-12 11:08:39
|
文件大小: 2.12MB
|
文件类型: -
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);
}
最后在把字体与材质应用到文本渲染组件