A widget class used for displaying health-related information in the HUD. Including Health Bar & Low Health Vignette.
More...
#include <HealthHUDWidget.h>
A widget class used for displaying health-related information in the HUD. Including Health Bar & Low Health Vignette.
- Todo
- Add in Damage Indicator
◆ ApplyDamageMaterial()
| void UHealthHUDWidget::ApplyDamageMaterial |
( |
| ) |
|
|
protected |
33{
36 {
37 UE_LOG(LogHealthSystem,
Error, TEXT(
"UHealthHUDWidget::ApplyDamageMaterial: Add Damage Vin Material"));
38 return;
39 }
40 if(GetWorld() != nullptr)
41 {
44 {
46 }
47 }
48}
◆ HealthAndShieldChanged()
| void UHealthHUDWidget::HealthAndShieldChanged |
( |
const float | Health, |
|
|
const float | MaxHealth, |
|
|
const float | ShieldHealth, |
|
|
const float | MaxShieldHealth, |
|
|
const class UDamageType * | DamageType ) |
|
overridevirtual |
Implements IHealthInterface.
61{
64 {
65 DamageVignette->SetScalarParameterValue(FName(
"Opacity"), ((
Health / MaxHealth) - 1.0f) * -1.0f);
67 {
68 if(ShieldHealth > 5.0f)
69 {
70 DamageVignette->SetScalarParameterValue(FName(
"Opacity"), ((ShieldHealth / MaxShieldHealth) - 1.0f) * -1.0f);
72 }
73 else
74 {
75 DamageVignette->SetScalarParameterValue(FName(
"Opacity"), ((
Health / MaxHealth) - 1.0f) * -1.0f);
77 }
78 }
79 }
80}
Definition Health.Build.cs:6
◆ HealthChanged()
| void UHealthHUDWidget::HealthChanged |
( |
const float | Health, |
|
|
const float | MaxHealth, |
|
|
const class UDamageType * | DamageType ) |
|
overridevirtual |
◆ Initialize()
| bool UHealthHUDWidget::Initialize |
( |
| ) |
|
|
overrideprotectedvirtual |
24{
25 const bool Success = Super::Initialize();
29 return true;
30}
◆ InjuredBodyPart()
| void UHealthHUDWidget::InjuredBodyPart |
( |
const EBodyPartName | InjuredBodyPart, |
|
|
const FVector & | HitLocation, |
|
|
const TArray< FBodyPart > & | AllBodyParts ) |
|
overridevirtual |
◆ NativeConstruct()
| void UHealthHUDWidget::NativeConstruct |
( |
| ) |
|
|
overridevirtual |
18{
19 Super::NativeConstruct();
21}
◆ NativePreConstruct()
| void UHealthHUDWidget::NativePreConstruct |
( |
| ) |
|
|
overridevirtual |
12{
13 Super::NativePreConstruct();
15}
◆ SetHasShield()
| void UHealthHUDWidget::SetHasShield |
( |
const bool | bHasShield | ) |
|
|
overridevirtual |
Implements IHealthInterface.
95{
98 if(bHasShield)
99 {
101 }
102 else
103 {
105 }
106
107}
◆ ShieldBreak()
| void UHealthHUDWidget::ShieldBreak |
( |
| ) |
|
|
overridevirtual |
◆ bShield
| bool UHealthHUDWidget::bShield = false |
|
private |
◆ DamageVignette
| UMaterialInstanceDynamic* UHealthHUDWidget::DamageVignette = nullptr |
|
protected |
◆ DamageVignetteMaterial
| UMaterialInterface* UHealthHUDWidget::DamageVignetteMaterial = nullptr |
|
protected |
◆ HealthColor
| FLinearColor UHealthHUDWidget::HealthColor = FLinearColor(0.548611f, 0.0f, 0.0f, 0.0f) |
|
protected |
◆ HealthWidget
◆ LowHealthImage
| class UImage* UHealthHUDWidget::LowHealthImage = nullptr |
|
protected |
◆ ShieldColor
| FLinearColor UHealthHUDWidget::ShieldColor = FLinearColor(0.1f, 0.0f, 0.5f, 0.0f) |
|
protected |
The documentation for this class was generated from the following files:
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/Health/Source/Health/Public/Widgets/HealthHUDWidget.h
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/Health/Source/Health/Private/Widgets/HealthHUDWidget.cpp