Initial HUD implementation and timer + game over
This commit is contained in:
45
Source/MyProject3/SpaceShooterHUD.h
Normal file
45
Source/MyProject3/SpaceShooterHUD.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/HUD.h"
|
||||
#include "SpaceShooterHUD.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class MYPROJECT3_API ASpaceShooterHUD : public AHUD
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
ASpaceShooterHUD();
|
||||
virtual void DrawHUD() override;
|
||||
|
||||
protected:
|
||||
UPROPERTY()
|
||||
UFont* TextFont;
|
||||
|
||||
// Bar configuration
|
||||
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
|
||||
float BarWidth = 200.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
|
||||
float BarHeight = 20.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
|
||||
float BarPadding = 10.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
|
||||
FLinearColor HealthBarColor = FLinearColor(1.0f, 0.0f, 0.0f, 1.0f); // Red
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
|
||||
FLinearColor ShieldBarColor = FLinearColor(0.0f, 0.5f, 1.0f, 1.0f); // Light Blue
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "HUD|Bars")
|
||||
FLinearColor BackgroundBarColor = FLinearColor(0.0f, 0.0f, 0.0f, 0.5f); // Semi-transparent black
|
||||
|
||||
private:
|
||||
void DrawGameplayHUD();
|
||||
void DrawGameOverScreen();
|
||||
void DrawStatusBars();
|
||||
class ASpaceShooterGameMode* GetGameMode() const;
|
||||
class ASpaceshipPawn* GetPlayerPawn() const;
|
||||
};
|
||||
Reference in New Issue
Block a user