Belven
(Belven)
1
I’m trying to just create some basic text on the screen for the conversation system for the game I’m working on. This is what I have so far:
FString pathSource = FPaths::GameSourceDir();
FString fontPath = "" + pathSource + "The_Battle_of_Maldon/Resources/Fonts/Baron Neue.otf";
ConstructorHelpers::FObjectFinder<UFont> FontObject(*fontPath);
UFont* font = FontObject.Object;
Canvas->DrawText(font, text, 1, 1);
It seems to be unable to find the font at that path, any ideas?
Also can someone point me to a normal windows font or something, just to clarify that the font works.
Rama
(Rama)
2
#Using UPROPERTY()
I recommend making your font asset ptr a UPROPERTY and then blueprinting the class where you store this ptr
then you can change it any time and you dont have asset paths hard coded.
/** Main Font! */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=VictoryHUD)
UFont* VictoryFont;
put this in the .h of a CPP class and then blueprint that class in the Editor, and make sure you are using the Blueprinted version
Easiest thing would be blueprinting a Player Controller class or HUD or Game Mode
I have wiki tutorial on that here:

Rama