RealtimeStyleTransferRuntime/Source/LyraGame/UI/LyraTouchRegion.h

42 lines
1.3 KiB
C
Raw Permalink Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
2022-09-13 07:18:28 +00:00
#include "Input/Reply.h"
2022-05-23 18:41:30 +00:00
#include "UI/LyraSimulatedInputWidget.h"
2022-09-13 07:18:28 +00:00
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "LyraTouchRegion.generated.h"
2022-09-13 07:18:28 +00:00
class UObject;
struct FFrame;
struct FGeometry;
struct FPointerEvent;
2022-05-23 18:41:30 +00:00
/**
* A "Touch Region" is used to define an area on the screen that should trigger some
* input when the user presses a finger on it
*/
UCLASS(meta=( DisplayName="Lyra Touch Region" ))
class LYRAGAME_API ULyraTouchRegion : public ULyraSimulatedInputWidget
{
GENERATED_BODY()
public:
//~ Begin UUserWidget
virtual FReply NativeOnTouchStarted(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent) override;
virtual FReply NativeOnTouchMoved(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent) override;
virtual FReply NativeOnTouchEnded(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent) override;
virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override;
//~ End UUserWidget interface
UFUNCTION(BlueprintCallable)
bool ShouldSimulateInput() const { return bShouldSimulateInput; }
protected:
/** True while this widget is being touched */
bool bShouldSimulateInput = false;
};