Files
WizardingHub/Source/WizardingCentral/UserWidgets/SpellOverlay.h
T
2024-12-19 21:44:09 -05:00

45 lines
1.5 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "SpellOverlay.generated.h"
/**
* A widget that displays the spell trace
*/
UCLASS()
class WIZARDINGCENTRAL_API USpellOverlay : public UUserWidget
{
GENERATED_BODY()
/** The points of the spell trace */
UPROPERTY(BlueprintReadWrite, Category = "Spell Overlay", meta = (AllowPrivateAccess = "true"))
TArray<FVector2D> SpellPoints;
/** The color of the spell trace */
UPROPERTY(BlueprintReadWrite, Category = "Spell Overlay", meta = (AllowPrivateAccess = "true"), EditAnywhere)
FLinearColor SpellLineColor = FLinearColor::Black;
/** The thickness of the spell trace */
UPROPERTY(BlueprintReadWrite, Category = "Spell Overlay", meta = (AllowPrivateAccess = "true"), EditAnywhere)
float SpellLineThickness = 2.0f;
/** Whether the spell trace should be anti-aliased */
UPROPERTY(BlueprintReadWrite, Category = "Spell Overlay", meta = (AllowPrivateAccess = "true"), EditAnywhere)
bool bAntiAlias = true;
public:
virtual int32
NativePaint(const FPaintArgs& Args,
const FGeometry& AllottedGeometry,
const FSlateRect& MyCullingRect,
FSlateWindowElementList& OutDrawElements,
int32 LayerId,
const FWidgetStyle& InWidgetStyle,
bool bParentEnabled) const override;
UFUNCTION(BlueprintCallable, Category = "Spell Overlay")
void
UpdateSpellPoints(const TArray<FVector2D>& NewSpellPoints);
};