Files
WizardingHub/Source/WizardingCentral/UserWidgets/SpellOverlay.h
T

60 lines
1.6 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;
protected:
virtual int32
NativePaint(const FPaintArgs& Args,
const FGeometry& AllottedGeometry,
const FSlateRect& MyCullingRect,
FSlateWindowElementList& OutDrawElements,
int32 LayerId,
const FWidgetStyle& InWidgetStyle,
bool bParentEnabled) const override;
public:
SIZE_T
GetNumPoints() const;
const FVector2D&
GetLastPoint();
const TArray<FVector2D>*
GetSpellPoints() const;
const FVector2D&
GetLastPoint(const FVector2D& CurrPoint);
void
AddPoint(const FVector2D& Point);
void
Clear();
};