Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
- #include "Elemental.h"
- #include "Json.h"
- #include "FileManager.h"
- DEFINE_LOG_CATEGORY_STATIC(LogGestures, All, All)
- UElementalGestureListener::UElementalGestureListener(const class FPostConstructInitializeProperties& PCIP)
- : Super(PCIP)
- , bIsListening(false)
- {
- }
- void UElementalGestureListener::SetController(AElementalPlayerController* InOwner)
- {
- MyController = InOwner;
- FOnDragStartEvent DragStartDelegate;
- DragStartDelegate.BindUObject(this, &UElementalGestureListener::OnDragStart);
- FOnDragUpdateEvent DragUpdateDelegate;
- DragUpdateDelegate.BindUObject(this, &UElementalGestureListener::OnDragUpdate);
- FOnDragEndEvent DragEndDelegate;
- DragEndDelegate.BindUObject(this, &UElementalGestureListener::OnDragEnd);
- MyController->RegisterDragEventDelegates(DragStartDelegate, DragUpdateDelegate, DragEndDelegate);
- }
- void UElementalGestureListener::OnDragStart(FVector2D const& ScreenPosition)
- {
- bIsListening = true;
- UE_LOG(LogGestures, Log, TEXT("GestureStart"));
- //FGesture newGesture = FGesture();
- //CurrentGesture = FGesture(newGesture);
- //tmpArray.Reset();
- CurrentGesture = FGesture();
- }
- void UElementalGestureListener::OnDragUpdate(FVector2D const& ScreenPosition)
- {
- if (bIsListening)
- {
- AddPointToShape(CurrentGesture.Shape, ScreenPosition);
- }
- }
- void UElementalGestureListener::OnDragEnd(FVector2D const& ScreenPosition)
- {
- bIsListening = false;
- }
- const void UElementalGestureListener::AddPointToShape(FShape& Shape, FVector2D const& Point)
- {
- CurrentGesture.Shape.Points.Add(Point);
- //tmpPoints.Add(Point)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement