blaster/Source/Blaster/HUD/BlasterHUD.h

45 lines
842 B
C
Raw Normal View History

2022-05-05 15:57:57 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/HUD.h"
#include "BlasterHUD.generated.h"
USTRUCT(BlueprintType)
struct FHUDPackage
{
GENERATED_BODY()
public:
UTexture2D* CrosshairsCenter;
UTexture2D* CrosshairsLeft;
UTexture2D* CrosshairsRight;
UTexture2D* CrosshairsTop;
UTexture2D* CrosshairsBottom;
2022-05-05 16:48:17 +00:00
float CrosshairSpread;
2022-05-05 15:57:57 +00:00
};
/**
*
*/
UCLASS()
class BLASTER_API ABlasterHUD : public AHUD
{
GENERATED_BODY()
public:
virtual void DrawHUD() override;
private:
FHUDPackage HUDPackage;
2022-05-05 16:48:17 +00:00
void DrawCrosshair(UTexture2D* Texture, FVector2D ViewportCenter, FVector2D Spread);
UPROPERTY(EditAnywhere)
float CrosshairSpreadMax = 16.f;
2022-05-05 16:16:59 +00:00
2022-05-05 15:57:57 +00:00
public:
FORCEINLINE void SetHUDPackage(const FHUDPackage& Package) { HUDPackage = Package; };
};