Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4079198
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:46:15+00:00 2026-05-20T17:46:15+00:00

I thought about keeping the amount of pixels the user has dragged the screen,

  • 0

I thought about keeping the amount of pixels the user has dragged the screen, by keeping a sum of the delta’s returned in the gestureSample object, but these delta’s don’t seem to be consistent:

EnabledGestures = GestureType.HorizontalDrag | GestureType.DragComplete;

foreach (GestureSample gestureSample in input.Gestures)
{
    if (gestureSample.GestureType == GestureType.HorizontalDrag)
    {      
         _dragOffset += gestureSample.Delta.X;
         System.Diagnostics.Debug.WriteLine("drag: " + _dragOffset + " - delta: " + gestureSample.Delta + " pos; " + gestureSample.Position);
    }
}

The code above displays the following:

  • drag: 0 – delta: {X:0 Y:0} pos; {X:692 Y:414}
  • drag: -4 – delta: {X:-4 Y:0} pos; {X:683 Y:415}
  • drag: -6 – delta: {X:-2 Y:0} pos; {X:676 Y:415}
  • drag: -8 – delta: {X:-2 Y:0} pos; {X:669 Y:415}
  • drag: -11 – delta: {X:-3 Y:0} pos; {X:658 Y:415}
  • drag: -15 – delta: {X:-4 Y:0} pos; {X:644 Y:415}

The absolute position of the GestureSample moved by -7 pixels but the delta only reports -2!

This happens both on the emulator as a real WP7 device. Is my interpretation of delta incorrect and should I not rely on it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:46:16+00:00Added an answer on May 20, 2026 at 5:46 pm

    I have found the issue: I was not processing all Gestures read from the TouchPanel. During 1 game cycle, multiple HorizontalDrag gestures can and will be recorded; they will not be merged into 1 gesture.

    Solution: make sure to go over ALL GestureSamples.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have never thought about until recently, but I'm not sure why we call
I have this object below: I thought about putting the messages in html like
I thought about the following question about computer's architecture. Suppose I do in Python
I thought about migrating subversion a lot and I have several questions still open.
I just thought about the non-blocking infrastructure of tornado and event-driven programming. Actually I'm
I had thought about decorating various control items with attributes to declare group ownership,
I know this might sound easy. I thought about using the first dot(.) which
In short, when you have planned or have thought about an idea to create
Before answering, it is not as easy question as you might have thought about
We have some performance problems with one of our applications. I thought about using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.