Hi Developers.
I want to get swipe event in Trigger.
I can see below.
TouchpadRepresents “Trigger” button,and is also used as a touchpad. It can detect touching and swipping. Customize Controller UI - NRSDK
I looked into MultiScreenController & NRVirtualDisplayer but I didn’t get how to get swipe event from Trigger. Anyone knows how to get swipping event correctly?
Hi Yuma, sorry to tell you that we haven’t give out the available interface for swiping event. But the following codes demonstrate how to listen to it. Hope it’s helpful for you.
preIsTouching = isTouching;
isTouching = NRInput.IsTouching();
if (!preIsTouching && isTouching)
{
mDownPos = NRInput.GetTouch();//Note the starting position of touching
mPointerDown = true;
Debug.LogError("Update touching downPos =" + mDownPos);
dragNormalizedValue = normalizedValue;
return;
}
if (isTouching)
{
if(Vector2.Distance(NRInput.GetTouch(),mDownPos)>0.1f)
{
//touch move. That means touch swipe
}
}
Hello Doris
Thank you for your code!!.
I forgot ‘NRInput’
I implemented like this with SystemInputState
I don’t know this is a best practice and this algo that gets a detection for swipe is not perfect. It feels lazy little bit