AHUD::DrawText problems; FVector2D

Hello, I have a problem with my code. I will attach a photo with errors. The problem starts with line 11, causes problems.

File MyHUD.cpp

#include "MyHUD.h"
#include "Math/Vector2D.h"

void AMyHUD::DrawHUD()
{
	Super::DrawHUD();
	DrawLine(200, 300, 400, 500, FLinearColor::Blue);
	DrawText("Unreal приветствует вас!", FVector2D(0, 0), hudFont,
		FVector2D(1, 1), FColor::White );

}

File MyHUD.h

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/HUD.h"
#include "MyHUD.generated.h"

/**
 * 
 */
UCLASS()
class PIZDEC_API AMyHUD : public AHUD
{
GENERATED_BODY()
public:
//шрифт тут как я понял HUDFont
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = HUDFont)
		UFont* hudFont;
			//функция чтобы изобразить hud
			virtual void DrawHUD() override;
};

1. FVector2D()
2. hudFont
3. FColor::White

I’m writing code from a book (I’m a super beginner, I’ve only been teaching for 4 days) and it’s outdated, I’m writing with further editing in Blue print.
How do I write code so that there are no build errors.

This code is a comment that says NPC

Please help, I really enjoyed writing code for games.
I was looking for answers in official the “book” on the ue engine, I tried to fix it myself, but nothing happened.

                                This is the answer.

If u need a answer.
Look at the syntax: (AHUD::DrawText | Unreal Engine Documentation)
And substitute the value into it.
How is it here:
DrawText(TEXT("HI THERE"), FColor(255.0f, 255.0f, 255.0f), (0.f, 0.f), (1.0f, 1.0f), hudFont, 1.0f, false);
Framed like this:

DrawText(const FString & Text, FLinearColor TextColor, float ScreenX, float ScreenY, UFont * Font, float Scale, bool bScalePosition);

const FString & Text, this is TEXT(“HI THERE”) and etc.

1 Like