Пример #1
0
        touchPressState isButtonPressed()
        {
            touchPressState st              = new touchPressState();
            int             x               = 0;
            int             y               = 0;
            bool            isInputPressed  = false;
            var             touchPanelState = TouchPanel.GetState();

            //var mouseState = Mouse.GetState();
            if (touchPanelState.Count >= 1)
            {
                var touch = touchPanelState[0];
                x = (int)touch.Position.X;
                y = (int)touch.Position.Y;
                isInputPressed = touch.State == TouchLocationState.Pressed || touch.State == TouchLocationState.Moved;
            }
            st.isPressed = isInputPressed;
            st.x         = x;
            st.y         = y;
            return(st);
        }
Пример #2
0
 touchPressState isButtonPressed()
 {
     touchPressState st = new touchPressState ();
     int x = 0;
     int y = 0;
     bool isInputPressed = false;
     var touchPanelState = TouchPanel.GetState();
     //var mouseState = Mouse.GetState();
     if(touchPanelState.Count >= 1)
     {
         var touch = touchPanelState[0];
         x = (int)touch.Position.X;
         y = (int)touch.Position.Y;
         isInputPressed = touch.State == TouchLocationState.Pressed || touch.State == TouchLocationState.Moved;
     }
     st.isPressed = isInputPressed;
     st.x = x;
     st.y = y;
     return st;
 }