I’m trying to use AHUD’s DrawText method. In a function called from DrawHUD(), I have:
DrawText("HIHIHI", ScreenPosition, Font, FVector2D(1, 1), FColor(0, 0, 0, 1));
where ScreenPosition is an FVector. Font is declared in the header like so:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "HUD Properties")
UFont* Font;
and initialized in the AHUD’s constructor like this:
ConstructorHelpers::FObjectFinder<UFont> FontObject(TEXT("Font'/Game/UI/HUDFont.HUDFont'"));
if (FontObject.Object)
{
Font = FontObject.Object;
}
The compile error I am getting is:
EvoHUD.cpp
C:\Users\ZachKN\Documents\Unreal Projects\Evo\Source\Evo\EvoHUD.cpp(126): error C2664: ‘void AHUD::DrawText(const FString &,FVector2D,UFont *,FVector2D,FColor)’ : cannot convert argument 3 from ‘UFont *’ to ‘float’
There is no context in which this conversion is possible
This is very confusing. Why would it be trying to convert to Float when 3rd argument is clearly supposed to be UFont?