本文整理汇总了C++中FPointerEvent::GetPointerIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ FPointerEvent::GetPointerIndex方法的具体用法?C++ FPointerEvent::GetPointerIndex怎么用?C++ FPointerEvent::GetPointerIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPointerEvent
的用法示例。
在下文中一共展示了FPointerEvent::GetPointerIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTouchEnded
FReply SVirtualJoystick::OnTouchEnded(const FGeometry& MyGeometry, const FPointerEvent& Event)
{
for (int32 ControlIndex = 0; ControlIndex < Controls.Num(); ControlIndex++)
{
FControlInfo& Control = Controls[ControlIndex];
// is this control the one captured to this pointer?
if (Control.CapturedPointerIndex == Event.GetPointerIndex())
{
// release and center the joystick
Control.ThumbPosition = FVector2D(0, 0);
Control.CapturedPointerIndex = -1;
// send one more joystick update for the centering
Control.bSendOneMoreEvent = true;
// Pass event as unhandled if time is too short
if (Control.bNeedUpdatedCenter)
{
Control.bNeedUpdatedCenter = false;
return FReply::Unhandled();
}
return FReply::Handled();
}
}
return FReply::Unhandled();
}
示例2: OnTouchStarted
FReply SVirtualJoystick::OnTouchStarted(const FGeometry& MyGeometry, const FPointerEvent& Event)
{
// UE_LOG(LogTemp, Log, TEXT("Pointer index: %d"), Event.GetPointerIndex());
FVector2D LocalCoord = MyGeometry.AbsoluteToLocal( Event.GetScreenSpacePosition() );
for (int32 ControlIndex = 0; ControlIndex < Controls.Num(); ControlIndex++)
{
FControlInfo& Control = Controls[ControlIndex];
// skip controls already in use
if (Control.CapturedPointerIndex == -1)
{
if (PositionIsInside(Control, LocalCoord, Control.InteractionSize))
{
// Align Joystick inside of Screen
AlignBoxIntoScreen(LocalCoord, Control.VisualSize, MyGeometry.Size);
Control.CapturedPointerIndex = Event.GetPointerIndex();
if (ActivationDelay == 0.f)
{
CurrentOpacity = ActiveOpacity;
if (!bPreventReCenter)
{
Control.VisualCenter = LocalCoord;
}
if (HandleTouch(ControlIndex, LocalCoord, MyGeometry.Size)) // Never fail!
{
return FReply::Handled();
}
}
else
{
Control.bNeedUpdatedCenter = true;
Control.ElapsedTime = 0.f;
Control.NextCenter = LocalCoord;
return FReply::Unhandled();
}
}
}
}
// CapturedPointerIndex[CapturedJoystick] = -1;
return FReply::Unhandled();
}
示例3: OnTouchEnded
FReply FSceneViewport::OnTouchEnded( const FGeometry& MyGeometry, const FPointerEvent& TouchEvent )
{
// Start a new reply state
CurrentReplyState = FReply::Handled();
UpdateCachedMousePos(MyGeometry, TouchEvent);
UpdateCachedGeometry(MyGeometry);
if( ViewportClient )
{
// Switch to the viewport clients world before processing input
FScopedConditionalWorldSwitcher WorldSwitcher( ViewportClient );
const FVector2D TouchPosition = MyGeometry.AbsoluteToLocal(TouchEvent.GetLastScreenSpacePosition());
if( !ViewportClient->InputTouch( this, TouchEvent.GetUserIndex(), TouchEvent.GetPointerIndex(), ETouchType::Ended, TouchPosition, FDateTime::Now(), TouchEvent.GetTouchpadIndex()) )
{
CurrentReplyState = FReply::Unhandled();
}
}
return CurrentReplyState;
}
示例4: OnTouchMoved
FReply SVirtualJoystick::OnTouchMoved(const FGeometry& MyGeometry, const FPointerEvent& Event)
{
FVector2D LocalCoord = MyGeometry.AbsoluteToLocal( Event.GetScreenSpacePosition() );
for (int32 ControlIndex = 0; ControlIndex < Controls.Num(); ControlIndex++)
{
FControlInfo& Control = Controls[ControlIndex];
// is this control the one captured to this pointer?
if (Control.CapturedPointerIndex == Event.GetPointerIndex())
{
if (Control.bNeedUpdatedCenter)
{
return FReply::Unhandled();
}
else if (HandleTouch(ControlIndex, LocalCoord, MyGeometry.Size))
{
return FReply::Handled();
}
}
}
return FReply::Unhandled();
}
示例5: PointerEvent_GetPointerIndex
int32 UKismetInputLibrary::PointerEvent_GetPointerIndex(const FPointerEvent& Input)
{
return Input.GetPointerIndex();
}