Search code examples
c#windows-phone-7touchxna-4.0

windows phone 7 - xna programming input gesture


Any events or how to recognize tap-down(touch down) and tap-up(touch up) as two different gesture in XNA +windows phone 7?


Solution

  • here it goes:

    TouchCollection touchCollection = TouchPanel.GetState();
            foreach (TouchLocation tl in touchCollection)
            {
                if (tl.State == TouchLocationState.Pressed)
                {
                      ...on touch down code
                }
    
                if (tl.State == TouchLocationState.Released)
                {
                      ...on touch up code
                }
    
            }