Nez.Portable/UI/Stage.cs
/// <summary>
/// Handle all the touch input events.
/// </summary>
Handle all the touch input events.
Handle all the touch input events .
void updateInputTouch()
        {
#if !FNA
            foreach (var touch in Input.touch.currentTouches)
            {
                var inputPos = screenToStageCoordinates(touch.Position);
                var inputPressed = touch.State == Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Pressed;
                var inputReleased = touch.State == Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Released
                                    || touch.State == Microsoft.Xna.Framework.Input.Touch.TouchLocationState.Invalid;
                var inputMoved = false;
                TouchLocation prevTouch;
                if (touch.TryGetPreviousLocation(out prevTouch))
                {
                    if (Vector2.Distance(touch.Position, prevTouch.Position) >= float.Epsilon)
                        inputMoved = true;
                }
                Element lastOver;
                _touchOverElement.TryGetValue(touch.Id, out lastOver);
                if (entity != null && !isFullScreen)
                    inputPos = Input.scaledPosition(inputPos);
                updateInputPoint(inputPos, inputPressed, inputReleased, inputMoved, ref lastOver);
                if (inputReleased)
                    _touchOverElement.Remove(touch.Id);
                else
                    _touchOverElement[touch.Id] = lastOver;
            }
#endif
        }
void updateInputTouch ( ) { if ! FNA foreach ( var touch in Input . touch . currentTouches ) { var inputPos = screenToStageCoordinates ( touch . Position ) ; var inputPressed = touch . State == Microsoft . Xna . Framework . Input . Touch . TouchLocationState . Pressed ; var inputReleased = touch . State == Microsoft . Xna . Framework . Input . Touch . TouchLocationState . Released || touch . State == Microsoft . Xna . Framework . Input . Touch . TouchLocationState . Invalid ; var inputMoved = false ; TouchLocation prevTouch ; if ( touch . TryGetPreviousLocation ( out prevTouch ) ) { if ( Vector2 . Distance ( touch . Position , prevTouch . Position ) >= float . Epsilon ) inputMoved = true ; } Element lastOver ; _touchOverElement . TryGetValue ( touch . Id , out lastOver ) ; if ( entity != null && ! isFullScreen ) inputPos = Input . scaledPosition ( inputPos ) ; updateInputPoint ( inputPos , inputPressed , inputReleased , inputMoved , ref lastOver ) ; if ( inputReleased ) _touchOverElement . Remove ( touch . Id ) ; else _touchOverElement [ touch . Id ] = lastOver ; } endif }
Handle all the touch input events.
Handle all the touch input events .