コード例 #1
0
 private void touchCancelledHandler(object sender, TouchEventArgs touchEventArgs)
 {
     update(touchEventArgs.Touch, _processTarget, _updateCancelled);
 }
コード例 #2
0
 private void touchesCancelledHandler(object sender, TouchEventArgs e)
 {
     sendMessageTarget.SendMessage(MessageName.OnTouchesCancelled.ToString(), e.Touches,
         SendMessageOptions.DontRequireReceiver);
 }
コード例 #3
0
 private void touchesEndedHandler(object sender, TouchEventArgs touchEventArgs)
 {
     update(touchEventArgs.Touches, _processTarget, _updateEnded);
 }
コード例 #4
0
 private void touchBeganHandler(object sender, TouchEventArgs touchEventArgs)
 {
     update(touchEventArgs.Touch, _processTargetBegan, _updateBegan);
 }
コード例 #5
0
 private void touchCancelledHandler(object sender, TouchEventArgs touchEventArgs)
 {
     updateCancelled(touchEventArgs.Touches);
 }
コード例 #6
0
ファイル: ITouchManager.cs プロジェクト: oafkad/TouchScript
 /// <summary>
 /// Returns cached instance of EventArgs.
 /// This cached EventArgs is reused throughout the library not to alocate new ones on every call.
 /// </summary>
 /// <param name="touch"> Touch for the event. </param>
 /// <returns>Cached EventArgs object.</returns>
 public static TouchEventArgs GetCachedEventArgs(TouchPoint touch)
 {
     if (instance == null) instance = new TouchEventArgs();
     instance.Touch = touch;
     return instance;
 }
コード例 #7
0
 private void touchBeganHandler(object sender, TouchEventArgs touchEventArgs)
 {
     updateBegan(touchEventArgs.Touches);
 }
コード例 #8
0
 private void touchMovedHandler(object sender, TouchEventArgs touchEventArgs)
 {
     updateMoved(touchEventArgs.Touches);
 }
コード例 #9
0
 /// <summary>
 /// Returns cached instance of EventArgs.
 /// This cached EventArgs is reused throughout the library not to alocate new ones on every call.
 /// </summary>
 /// <param name="touches">A list of touches for event.</param>
 /// <returns>Cached EventArgs object.</returns>
 public static TouchEventArgs GetCachedEventArgs(IList<TouchPoint> touches)
 {
     if (instance == null) instance = new TouchEventArgs();
     instance.Touches = touches;
     return instance;
 }
コード例 #10
0
 private void touchesCancelledHandler(object sender, TouchEventArgs e)
 {
     sendMessageTarget.SendMessage(MessageName.OnTouchesCancelled.ToString(), e.Touches,
                                   SendMessageOptions.DontRequireReceiver);
 }
コード例 #11
0
        private void updateManuallyCancelled(List <CancelledTouch> points)
        {
            var cancelledCount = points.Count;
            var list           = touchListPool.Get();
            var redispatchList = touchListPool.Get();
            var releaseList    = touchListPool.Get();

            for (var i = 0; i < cancelledCount; i++)
            {
                var        data = points[i];
                var        id   = data.Id;
                TouchPoint touch;
                if (!idToTouch.TryGetValue(id, out touch))
                {
                    // might be dead already
                    continue;
                }

                if (data.Redispatch)
                {
                    redispatchList.Add(touch);
                }
                else
                {
                    idToTouch.Remove(id);
                    touches.Remove(touch);
                    releaseList.Add(touch);
#if DEBUG
                    removeDebugFigureForTouch(touch);
#endif
                }

                list.Add(touch);
                if (touch.Layer != null)
                {
                    touch.Layer.INTERNAL_CancelTouch(touch);
                }
            }

            if (touchesCancelledInvoker != null)
            {
                touchesCancelledInvoker.InvokeHandleExceptions(this, TouchEventArgs.GetCachedEventArgs(list));
            }

            touchListPool.Release(list);
            var count = releaseList.Count;
            for (var i = 0; i < count; i++)
            {
                touchPointPool.Release(releaseList[i] as TouchPoint);
            }
            touchListPool.Release(releaseList);

            count = redispatchList.Count;
            if (count > 0)
            {
                var layerCount = layers.Count;
                for (var i = 0; i < count; i++)
                {
                    var touch = redispatchList[i] as TouchPoint;
                    for (var j = 0; j < layerCount; j++)
                    {
                        var touchLayer = Layers[j];
                        if (touchLayer == null)
                        {
                            continue;
                        }
                        if (touchLayer.INTERNAL_BeginTouch(touch))
                        {
                            break;
                        }
                    }
                }
                if (touchesBeganInvoker != null)
                {
                    touchesBeganInvoker.InvokeHandleExceptions(this, TouchEventArgs.GetCachedEventArgs(redispatchList));
                }
            }
            touchListPool.Release(redispatchList);
        }
コード例 #12
0
 private void touchesCancelledHandler(object sender, TouchEventArgs touchEventArgs)
 {
     update(touchEventArgs.Touches, _processTarget, _updateCancelled);
 }
コード例 #13
0
 private void touchesBeganHandler(object sender, TouchEventArgs touchEventArgs)
 {
     update(touchEventArgs.Touches, _processTargetBegan, _updateBegan);
 }