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.