RealtimeStyleTransferRuntime/Source/LyraGame/UI/LyraTouchRegion.cpp

40 lines
1.2 KiB
C++
Raw Permalink Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "UI/LyraTouchRegion.h"
2022-09-13 07:18:28 +00:00
#include "Math/MathFwd.h"
#include "Math/Vector.h"
struct FGeometry;
struct FPointerEvent;
2022-05-23 18:41:30 +00:00
FReply ULyraTouchRegion::NativeOnTouchStarted(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent)
{
bShouldSimulateInput = true;
return Super::NativeOnTouchStarted(InGeometry, InGestureEvent);
}
FReply ULyraTouchRegion::NativeOnTouchMoved(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent)
{
// Input our associatied key as long as the player is touching within our bounds
//InputKeyValue(FVector::OneVector);
bShouldSimulateInput = true;
// Continuously trigger the input if we should
return Super::NativeOnTouchMoved(InGeometry, InGestureEvent);
}
FReply ULyraTouchRegion::NativeOnTouchEnded(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent)
{
bShouldSimulateInput = false;
return Super::NativeOnTouchEnded(InGeometry, InGestureEvent);
}
void ULyraTouchRegion::NativeTick(const FGeometry& MyGeometry, float InDeltaTime)
{
Super::NativeTick(MyGeometry, InDeltaTime);
if(bShouldSimulateInput)
{
InputKeyValue(FVector::OneVector);
}
}