Is it possible to use a swipe function on CCGameView?
var touchListener = new CCEventListenerTouchAllAtOnce ();
touchListener.OnTouchesMoved = OnTouchesMoved;
AddEventListener (touchListener, this);
void OnTouchesMoved (List<CCTouch> touches, CCEvent touchEvent)
Then simply loop through touches finding distance between their PreviousLocation & Location
Have you tried using touches.DELTA ? For example. b2Body.ApplyForceToCenter(new beVec2(touches.DELTA.X, touches.DELTA.Y)
I have a simple implementation set up using the stopwatch to detect swipe duration and by calculating the distance of the swipe in a certain direction. Then you just define your thresholds for maximal duration and minimal distance of the swipe. I could share it later if you want.
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies